thuml / Time-Series-Library

A Library for Advanced Deep Time Series Models.
MIT License
6.95k stars 1.1k forks source link

Win 10 with Nvidia GPU, env: Python 3.11+ Torch>=2.0.0 + PyTorch-Cuda>= 11.0, run.py works with GPU mode #536

Closed rendezvoush closed 1 month ago

rendezvoush commented 1 month ago

The installation is as following :

conda create -n TSLib python=3.11 conda activate TSLib conda install -c pytorch -c nvidia -c conda-forge pytorch-cuda>=11.0 pytorch>=2.0.0 pip install -r requirements # please delete all the versions specified, just keep the package names, and delete torch#

And then launch run.py with arguments, there wil be 2 errors, just modify them:

for error 1:
change line 188 of " $(virtenv)/Lib/site-package/sktime/utils/_estimator_html_repr.py", to:
with open(Path(file).parent / "_estimator_html_repr.css", 'rb') as style_file:

error 2:

under your TSLib working directory, change line 37 of "utils/tools.py", to :
in init self.val_loss_min = np.inf

That's all. Just verify with the default run.py, it works with GPU mode.

Musongwhk commented 1 month ago

Hi. Thank you for your issue and solution. Different versions of packages and different Python environments may lead to some errors, and your solution will be helpful to others who have similar doubts.