From 2a170624216c5344c039edec9173a74370d3de86 Mon Sep 17 00:00:00 2001 From: Jactus Date: Thu, 26 Nov 2020 13:49:51 +0800 Subject: [PATCH] Update run_all_model and format --- examples/benchmarks/TFT/README.md | 4 ++-- examples/run_all_model.py | 15 --------------- qlib/contrib/model/pytorch_lstm.py | 1 - 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/examples/benchmarks/TFT/README.md b/examples/benchmarks/TFT/README.md index e9e44db1a..5a6a9f153 100644 --- a/examples/benchmarks/TFT/README.md +++ b/examples/benchmarks/TFT/README.md @@ -8,7 +8,7 @@ Users can follow the ``workflow_by_code_tft.py`` to run the benchmark. ### Notes -1. Please be **aware** that this script can only support `Python 3.5 - 3.8`, and `Cuda 10.0 or 10.1`. -2. Please remember to install `cudatoolkit==10.1` and `cudnn==7.6` on your machine. +1. Please be **aware** that this script can only support `Python 3.5 - 3.8`. +2. If the CUDA version on your machine is not 10.0, please remember to run the following commands `conda install anaconda cudatoolkit=10.0` and `conda install cudnn` on your machine. 3. The model must run in GPU, or an error will be raised. 4. New datasets should be registered in ``data_formatters``, for detail please visit the source. diff --git a/examples/run_all_model.py b/examples/run_all_model.py index b09750674..2f6c4299e 100644 --- a/examples/run_all_model.py +++ b/examples/run_all_model.py @@ -162,20 +162,6 @@ class ExtendedEnvBuilder(venv.EnvBuilder): self.install_script(context, "pip", url) -# function to check cuda version on the machine, this case is for the model TFT -def check_cuda(folders): - path = "/usr/local/cuda/version.txt" # TODO: FIX ME, this will not work on other os systems. - exclude_tft = True - if os.path.exists(path): - with open(path, "r") as f: - if "10.1" in str(f.read()) or "10.0" in str(f.read()): - exclude_tft = False - if exclude_tft and "TFT" in folders: - sys.stderr.write("Compatible CUDA version not found! Removing TFT from the workflow...\n") - del folders["TFT"] - return folders - - # function to calculate the mean and std of a list in the results dictionary def cal_mean_std(results) -> dict: mean_std = dict() @@ -205,7 +191,6 @@ def get_all_folders(models, exclude) -> dict: if add: path = Path("benchmarks") / f.name folders[f.name] = str(path.resolve()) - folders = check_cuda(folders) return folders diff --git a/qlib/contrib/model/pytorch_lstm.py b/qlib/contrib/model/pytorch_lstm.py index adb895247..be43d3698 100755 --- a/qlib/contrib/model/pytorch_lstm.py +++ b/qlib/contrib/model/pytorch_lstm.py @@ -38,7 +38,6 @@ class LSTM(Model): the GPU ID(s) used for training """ - def __init__( self, d_feat=6,