Open INGnowait opened 3 years ago
It looks like you didn't put the model or tensor on the GPU device. Can you provide more details?
when I runned the codes "train.py" and ''train_AdaLSN.py', there will be errors :
' due to scipy/scipy#11299), please set init_weights=True.', FutureWarning)
Loading pretrained weights from ./../dataset/models/inception_v3_google-1a9a5a14.pth
08/07 01:12:16 PM params:28.575M
Traceback (most recent call last):
File "train_AdaLSN.py", line 65, in
I tried to find some solutions, and part of the result pointed out that the problem was in this code "torch.set_default_tensor_type('torch.cuda.FloatTensor')"
In addtion, when I tried the code "python train.py --network deep_flux",there would be the error: "TypeError: init() takes 2 positional arguments but 3 were given". I changed the code “ dataset = TrainDataset(args.files, args.root)” in the “train.py” into " dataset = TrainDataset((args.files, args.root))". The error disappered. However, this code in the "train_AdaLSN.py" donnot need to be modified.
Except for the necessary paths and the above modifications, I did not make adjustments to other parts of the code. My environment is: ubuntu18.04, anaconda3, Cuda11.1(RTX3090), pytroch1.9.0
Based on this information above I still can’t determine where the problem is. And I did not encounter this error when I tried the code... Maybe it's a problem with cuda and pytorch version. I adopt cuda10.2 and pytorch1.1. If you want to discuss more conveniently, please add me on WeChat: sunsmarterjie.
Deepflux needs another DataLoader (at the top of train.py).
you probably installed the cpu based torch version in your environment. Go through the steps to install pytorch again and make sure the source uses the CUDA version and not the CPU version.
I faced with the same bug when I use Ubuntu20.04 as developing platform. The solution is type a '#' before 40 line of train.py (torch.set_default_tensor_type('torch.cuda.FloatTensor))
There may remain some bugs in pytorch's early code.
when I try to run the codes,there is the wrong: "RuntimeError: Expected a 'cuda' device type for generator but found 'cpu'". How can I solve it?
Thank you.