Open PENGthu opened 1 year ago
I just ran the code that was released and the same script, and did not encounter this issue.
I believe the first error is most likely due to the PyTorch version. The second error you mentioned is caused by the failure of the first command execution. If you open the file 'script/S2P_CUFS_CUFSF/S2P_CUFS_CUFSF_no_recognition.sh,' you will find that this script is designed to execute four Python commands sequentially. The subsequent Python commands rely on the results saved from the previous ones. Therefore, if any of the preceding Python commands encounter an error, it will lead to errors in the subsequent ones as well.
I used the following command to check my PyTorch version:
python
Python 3.7.9 (default, Aug 31 2020, 12:42:55)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.__version__
'1.8.2'
The first error you encountered (one of the variables needed for gradient computation has been modified by an inplace operation) is likely due to certain in-place operations that are not working effectively on your PyTorch version. Please provide your PyTorch version. I think that with a not-too-old version of PyTorch, there should be no this problem. On your PyTorch version, I suspect the error might be related to the forward() function of class Conv2dBlock in CMOS-GAN_code_refactor/networks/blocks.py.
Perhaps you can modify it like this:
def forward(self, x):
x = self.conv(self.pad(x))
if self.norm:
x = self.norm(x)
if self.activation:
out = self.activation(x)
return out
Below are the results of running the script 'bash script/S2P_CUFS_CUFSF/S2P_CUFS_CUFSF_no_recognition.sh' in my environment.
bash script/S2P_CUFS_CUFSF/S2P_CUFS_CUFSF_no_recognition.sh /data/skyu/W002/CMOS-GAN_code_refactor/options/base_options.py:48: YAMLLoadWarning: calling yaml.load() without Loader= ... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. config =yaml.load(stream) 1,3 #################### cuda:0 #################### /data/skyu/W002/CMOS-GAN_code_refactor/stools/sutil.py:215: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. config =yaml.load(stream) [34] serial_probility=0.25
[34] serial_probility=0.25
[34] serial_probility=0.25
9560 [31, 32, 33] [34] modelCrossModality_S2P initialize_S2P #########train from scratch############# lr=0.0002 lr=0.0001 lr=0.0002 model [modelCrossModality] was created lr=0.0002 lr=0.0001 lr=1e-05 lr=0.0002 enumerate 0 loss_G_X2Y_target 3.0017037391662598 loss_L1_X2Y_source 60.93376159667969 loss_ffl 34.575008392333984 classify_loss_forG idx0 correct num= 0/32 loss_cls_trainG_fake_Y_source 12.338781356811523 classify_loss_forG idx1 correct num= 0/32 loss_cls_trainG_fake_Y_target 11.850801467895508 loss_D_Y= 3.006690263748169 classify_loss_forC idx0 correct num= 0/32 classify_loss_forC idx2 correct num= 0/32 classify_loss_forC idx3 correct num= 0/32 loss_cls_fake_Y_source=10.72421932220459 loss_cls_data_Y_source=13.480998039245605 loss_cls_fake_Y_target=11.661787986755371 enumerate 1 loss_G_X2Y_target 2.727379083633423 loss_L1_X2Y_source 48.93858337402344 loss_ffl 29.83761978149414 classify_loss_forG idx0 correct num= 0/32 loss_cls_trainG_fake_Y_source 14.859338760375977 classify_loss_forG idx1 correct num= 0/32 loss_cls_trainG_fake_Y_target 15.499336242675781 loss_D_Y= 2.6908960342407227 classify_loss_forC idx0 correct num= 1/32 classify_loss_forC idx2 correct num= 0/32 classify_loss_forC idx3 correct num= 0/32 loss_cls_fake_Y_source=12.222427368164062 loss_cls_data_Y_source=13.191264152526855 loss_cls_fake_Y_target=10.940000534057617 enumerate 2 loss_G_X2Y_target 2.381397247314453 loss_L1_X2Y_source 45.20701599121094 loss_ffl 28.456880569458008 classify_loss_forG idx0 correct num= 0/32 loss_cls_trainG_fake_Y_source 14.414983749389648 classify_loss_forG idx1 correct num= 0/32 loss_cls_trainG_fake_Y_target 13.29682445526123
... It can be seen that the program has started running normally.
Hi there, Thanks a lot for your work! When running the script
bash script/S2P_CUFS_CUFSF/S2P_CUFS_CUFSF_no_recognition.sh
,There's a problem below:Then:
I have downloaded the dataset: 'CMOS-GAN/dataset/Viewed/AUG_3_9_AR' 'CMOS-GAN/dataset/Viewed/AUG_3_9_CUFSF' 'CMOS-GAN/dataset/Viewed/AUG_3_9_CUHK' 'CMOS-GAN/dataset/Viewed/AUG_3_9_XM2VTS' Is there any problem? Thanks!