RunTimeError: Providing a bool or integral fill value without setting the optional 'dtype' or 'out' arguments is currently unsupported.
prashanth31 opened this issue · 1 comments
When I run the code with the following packages, I get a run time error. Could anyone help me solve it?
python 3.8.8
torch 1.6.0
cudatoolkit 10.2.89
Error message here
Traceback (most recent call last):
File "main_train.py", line 29, in
train(opt, Gs, Zs, reals, NoiseAmp)
File "c:\Projects\PK\Phd\Paper4_GAN\SinGAN-master\SinGAN\training.py", line 39, in train
z_curr,in_s,G_curr = train_single_scale(D_curr,G_curr,reals,Gs,Zs,in_s,NoiseAmp,opt)
File "c:\Projects\PK\Phd\Paper4_GAN\SinGAN-master\SinGAN\training.py", line 80, in train_single_scale
z_opt = torch.full(fixed_noise.shape, 0, device=opt.device)
RuntimeError: Providing a bool or integral fill value without setting the optional dtype
or out
arguments is currently unsupported. In PyTorch 1.7, when dtype
and out
are not set a bool fill value will return a tensor of torch.bool dtype, and an integral fill value will return a tensor of torch.long dtype._
This is a version issue. I got the code working after I downgraded torch and python.
Here are all the versions in case someone else runs into problems
I first installed python 3.6 into a new environment called torch
python 3.6.13
conda create -n torch python=3.6
conda activate torch
Then I installed the torch libraries along with cuda toolkit
torch 1.4.0
torchvision 0.5.0
conda install pytorch==1.4.0 torchvision==0.5.0 cudatoolkit=10.1 -c pytorch
Then I installed matplotlib (3.3.4), scikit-image (0.17.2) and scikit-learn (0.24.1). Scipy (1.5.2) and numpy (1.19.2) were automatically installed