Open yobrepus opened 2 years ago
Hi Well, you need to provide the error message so that I can help you.
The shapes seem to be correct. k should indicate the class label, so it should be 0 or 1.
Hi,
Please see the error message below. By the way, I run the code on colab.
Defaults for this optimization level are: enabled : True opt_level : O1 cast_model_type : None patch_torch_functions : True keep_batchnorm_fp32 : None master_weights : None loss_scale : dynamic Processing user overrides (additional kwargs that are not None)... After processing overrides, optimization options are: enabled : True opt_level : O1 cast_model_type : None patch_torch_functions : True keep_batchnorm_fp32 : None master_weights : None loss_scale : dynamic Warning: multi_tensor_applier fused unscale kernel is unavailable, possibly because apex was installed without --cuda_ext --cpp_ext. Using Python fallback. Original ImportError was: ModuleNotFoundError("No module named 'amp_C'") Selected optimization level O1: Insert automatic casts around Pytorch functions and Tensor methods.
Defaults for this optimization level are:
enabled : True
opt_level : O1
cast_model_type : None
patch_torch_functions : True
keep_batchnorm_fp32 : None
master_weights : None
loss_scale : dynamic
Processing user overrides (additional kwargs that are not None)...
After processing overrides, optimization options are:
enabled : True
opt_level : O1
cast_model_type : None
patch_torch_functions : True
keep_batchnorm_fp32 : None
master_weights : None
loss_scale : dynamic
[Errno 99] Cannot assign requested address
on_close() takes 1 positional argument but 3 were given
[Errno 99] Cannot assign requested address
on_close() takes 1 positional argument but 3 were given
tensor([1, 1, 0, 0, 1, 1, 1, 1, 1, 1])
epoch 0 iter 0 torch.Size([10, 256, 256, 1])
torch.Size([8, 1, 256, 256])
torch.Size([1])
[Errno 99] Cannot assign requested address
on_close() takes 1 positional argument but 3 were given
[Errno 99] Cannot assign requested address
on_close() takes 1 positional argument but 3 were given
Traceback (most recent call last):
File "main.py", line 56, in
Hi
There seems to be a problem with apex. Did you install it correctly? You could try to set the optimization level to 'O0' instead of 'O1', or leave out the Automatic Mixed Precision (amp) in lines 135, 136, 282 and 393.
Let me know if this solves the problem.
Hi
Can you give me more detail about setting the optimization level to 'O0' instead of 'O1', or leave out the Automatic Mixed Precision (amp) in lines 135, 136, 282, and 393? Where can I find it?
You can choose the optimization level 'O0' in lines 132 and 133 in the file model/DeScarGAN.py, as well as in lines 77 and 78 of the file _Evaluation/Evaluation_SyntheticDataset.py and in lines 81 and 82 of the file _Evaluation/EvaluationChexpert.py. If this does not work, you leave out those lines. Furthermore, in the file model/DeScarGAN.py you just run d_loss.backward() in line 270, and g_loss.backward() in line 370.
I found the error at this line (out_k, klasse_k) = netD(inputs[v_krank][:,0,:,:,:],k). Please suggest me how to fix this.
shape of inputs[v_krank][:,0,:,:,:] is [8, 1, 256, 256] shape of k is [1]