Open nourgeek opened 1 year ago
Hi there, are you sure that you didn't modify anything? I double checked the code works well on my Linux/Ubuntu machines with the environment.yml.
If the problems exist, could consider modify https://github.com/Zhendong-Wang/Diffusion-GAN/blob/2ca5e7aa21f07a3ff0e78966e5796c580126c14f/diffusion-insgen/training/augment.py#L202 , where you want the t to be long tensors.
Hi, Thanks for your response. I changed to Linux/Ubuntu and used the environment.yml, but unfortunately there is another error:
warnings.warn('Failed to build CUDA kernels for upfirdn2d. Falling back to slow reference implementation. Details:\n\n' + traceback.format_exc())
Traceback (most recent call last):
File "train.py", line 603, in
I would be glad if there is any way you know how to fix this.
This problem is inherited from InsGen code. The issue is solved here https://github.com/Zhendong-Wang/Diffusion-GAN/issues/10
Hi, I wanted to train a model with cifar dataset, so I followed the steps described in the readme; but while running the train.py file exactly as you described in the readme, I got an error which you can see below:
Traceback (most recent call last): File "train.py", line 603, in
main() # pylint: disable=no-value-for-parameter
File "C:\ProgramData\miniconda3\envs\difgan\lib\site-packages\click\core.py", line 1128, in call
return self.main(args, kwargs)
File "C:\ProgramData\miniconda3\envs\difgan\lib\site-packages\click\core.py", line 1053, in main
rv = self.invoke(ctx)
File "C:\ProgramData\miniconda3\envs\difgan\lib\site-packages\click\core.py", line 1395, in invoke
return ctx.invoke(self.callback, ctx.params)
File "C:\ProgramData\miniconda3\envs\difgan\lib\site-packages\click\core.py", line 754, in invoke
return __callback(args, kwargs)
File "C:\ProgramData\miniconda3\envs\difgan\lib\site-packages\click\decorators.py", line 26, in new_func
return f(get_current_context(), *args, kwargs)
File "train.py", line 596, in main
subprocess_fn(rank=0, args=args, temp_dir=temp_dir)
File "train.py", line 422, in subprocess_fn
training_loop.training_loop(rank=rank, args)
File "C:\Users\user\Desktop\Project\Diffusion-GAN\diffusion-insgen\training\training_loop.py", line 351, in training_loop
loss.accumulate_gradients(phase=phase.name, real_img=real_img, real_c=real_c, gen_z=gen_z, gen_c=gen_c, sync=sync, gain=gain, cl_phases=cl_phases, D_ema=D_ema, g_fake_cl=not no_cl_on_g, *cl_loss_weight)
File "C:\Users\user\Desktop\Project\Diffusion-GAN\diffusion-insgen\training\contrastive_loss.py", line 92, in accumulate_gradients
gen_logits = self.run_D(gen_img, gen_c, sync=False)
File "C:\Users\user\Desktop\Project\Diffusion-GAN\diffusion-insgen\training\contrastive_loss.py", line 55, in run_D
img, t = self.augment_pipe(img)
File "C:\ProgramData\miniconda3\envs\difgan\lib\site-packages\torch\nn\modules\module.py", line 889, in _call_impl
result = self.forward(input, kwargs)
File "C:\Users\user\Desktop\Project\Diffusion-GAN\diffusion-insgen\training\augment.py", line 203, in forward
x_t = q_sample(x_0, alphas_bar_sqrt, one_minus_alphas_bar_sqrt, t,
File "C:\Users\user\Desktop\Project\Diffusion-GAN\diffusion-insgen\training\augment.py", line 86, in q_sample
alphas_t_sqrt = alphas_bar_sqrt[t].view(-1, 1, 1, 1)
IndexError: tensors used as indices must be long, byte or bool tensors
I used environment.yml given in the directory as my environment. My PC specs: Windows 10 64bit - Nvidia GTX 1660 Thanks in advance for your help