UGATIT-pytorch
UGATIT-pytorch copied to clipboard
Error during test: local variable 'A2B' referenced before assignment
I could successfully train the model on my own dataset, and I can see that the trained models are saved in the model folder already. However, I got the following error when I ran test code "python main.py --dataset experiment1 --phase test --light True". Do you know where might go wrong?
Thanks!
The error is:
'''
[*] Load SUCCESS
Traceback (most recent call last):
File "main.py", line 83, in
Could you please also help me to understand the images generated during the training? For example in the picture below, I got 7 rows of images, I don't understand why my 3rd, 5th, 6th, 7th rows are empty.

As for the first question, you could add
A2B = np.zeros((self.img_size * 7, 0, 3))
B2A = np.zeros((self.img_size * 7, 0, 3))
at the begining of test function.
For the second, I think your network is just broke, it is not correctly trained at all.
I suggest a warmup should be added at the beginning of training. For example, I linearly increased the learning rate from 0 to 0.0001 at the first 2000 iterations, which performed well in my task.
As for the first question, you could add
A2B = np.zeros((self.img_size * 7, 0, 3)) B2A = np.zeros((self.img_size * 7, 0, 3))at the begining of test function.
As I understand - test function isn't work? Add pr for fix it? or you already fix it, @Trueyellow?
As for the first question, you could add
A2B = np.zeros((self.img_size * 7, 0, 3)) B2A = np.zeros((self.img_size * 7, 0, 3))at the begining of test function.
As I understand - test function isn't work? Add pr for fix it? or you already fix it, @Trueyellow?
Yes, the originial test function doesn't work. In fact, according to my usage, the pytorch version of UGATIT has many differences compared with tensorflow version. If I have time, I would open a PR to fix all those differences(BUGs). If anyone want to training a new model from scratch and reproduce the result like paper, I suggest the tensorflow version.
Same question here as what @qiuyuchen14 asked.