Closed nhy17-thu closed 3 years ago
Hi @nhy17-thu. The error says that xyz1 must be a CUDA tensor
. Could you check what device the pred
and gt
are on?
Hi @nhy17-thu. The error says that
xyz1 must be a CUDA tensor
. Could you check what device thepred
andgt
are on?
Hi Duc! Sorry for the late response, but I have solved the problem by simply changing one line in train.py
:
mon.run_training(net, solver, train_loader, n_epochs, scheduler=scheduler, eval_loader=val_loader, valid_freq=val_freq, reduce='mean')
to
mon.run_training(net, solver, train_loader, n_epochs, scheduler=scheduler, eval_loader=val_loader, valid_freq=val_freq, reduce='mean', device='cuda')
Which tells the monitor to use the cuda
device. Maybe this could also be updated in your own code by adding an if
statement with nnt.cuda_available
to select device automatically in code :)
Anyway, the code can run successfully now, and thank you so much for your help!
I have meet the same problem,and add ‘device=cuda’ can solve the problem,thanks very much.
It seems the code does not support multi-GPUs.
Hi @justanhduc, I've successfully installed all the requirements including the latest Cuda version of your
neuralnet-pytorch
package. However, when I runpython train.py configs/lowrankgraphx-up-final.gin --gpu 0
, the following error message comes out:My environment:
Meanwhile, training with CPU works well while too slow. Could you please find out the reason for this error and help me solve it? Thanks!