-
-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can we use gpu when run demo fin_model? #445
Comments
Hi, You could firstly check if you've chosen the correct base image in your Dockerfile to support GPU functionality. |
I think I have right docker file, the codes are listed below. For GPU support, please choose the proper tag from https://hub.docker.com/r/pytorch/pytorch/tagsRUN apt-get clean && apt-get update && apt-get install -y \ RUN git clone https://github.com/microsoft/qlib.git WORKDIR /workspace/qlib RUN git reset c9ed050ef034fe6519c14b59f3d207abcb693282 --hard RUN python -m pip install --upgrade cython -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple RUN pip install catboost -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple I also successfully generarte docker image called "local_qlib", and if I run this image by "docker run --rm -ti --gpus all local_qlib /bin/bash", I can see normal output by running "nvidia-smi" in this image. +---------------------------------------------------------------------------------------+ However, when I run "rdagent fin_model", the ERROR are listed below.
|
Besides, it seems the docker container can correctly detect the gpu device, the log detail are listed below. 2024-10-21 20:20:18.348 | INFO | rdagent.utils.env:_gpu_kwargs:269 - GPU Devices are available. |
when i run "rdagent fin_model", it works well on my cpu to train a GRU. How to use gpu device such as "cuda:0" to run this demo?
Some outputs of my terminal when running this script are as follows:
[1:MainThread](2024-10-21 03:13:05,144) INFO - qlib.GeneralPTNN - [pytorch_general_nn.py:74] - GeneralPTNN pytorch version...
[1:MainThread](2024-10-21 03:13:05,157) INFO - qlib.GeneralPTNN - [pytorch_general_nn.py:92] - GeneralPTNN parameters setting:
n_epochs : 100
lr : 0.001
metric : loss
batch_size : 2000
early_stop : 10
optimizer : adam
loss_type : mse
device : cpu
n_jobs : 20
use_GPU : False
weight_decay : 0.0001
seed : None
pt_model_uri: model.model_cls
pt_model_kwargs: {'num_features': 20, 'num_timesteps': 20}
[1:MainThread](2024-10-21 03:13:05,158) INFO - qlib.GeneralPTNN - [pytorch_general_nn.py:129] - model:
EnhancedDeepGRUModel(
(gru): GRU(20, 256, num_layers=5, batch_first=True, dropout=0.4)
(fc): Linear(in_features=256, out_features=1, bias=True)
)
The text was updated successfully, but these errors were encountered: