CSC2548 / text2image2textGAN

21 stars 9 forks source link

NameError: name 'cycle_trainer' is not defined #6

Closed abhineet99 closed 4 years ago

abhineet99 commented 4 years ago

Traceback (most recent call last): File "runtime.py", line 55, in cycle_trainer.train(args.cls) NameError: name 'cycle_trainer' is not defined

Do you have the code available for cycle_gan end to end training? It seems that this has been accepted as an argument but no implementation is available in trainer.py

dany87kuo commented 3 years ago

hello,Do you sucess run this repo?

abhineet99 commented 3 years ago

Yes I did, had to make some changes though. Might be able to help if you can pin point the issues you're facing?

dany87kuo commented 3 years ago

@abhineet99 Thanks for yorr help! I want to ask what environment you use? I use conda python2.7 pytorch0.4 and torchvision 0.2.1 When I run start_pretraining.sh by this command: python runtime.py --type=pretrain_caption --dataset=flowers I got this error: /home/dany/text2image2textGAN-master/txt2image_dataset.py:28: ParserWarning: Falling back to the 'python' engine because the 'c' engine does not support regex separators (separators > 1 char and different from '\s+' are interpreted as regex); you can avoid this warning by specifying engine='python'. self.image_paths_df = pd.read_table('data/images.txt', sep='\s+|\/+', header=None) False pretrain_caption gan 0%| | 0/100 [00:07<?, ?it/s] Traceback (most recent call last): File "runtime.py", line 52, in trainer.train(args.cls, args.interp) File "/home/dany/text2image2textGAN-master/trainer.py", line 140, in train self._pretrain_caption() File "/home/dany/text2image2textGAN-master/trainer.py", line 190, in _pretrain_caption gen_losses.append(loss_gen.cpu().data.numpy()[0]) IndexError: too many indices for array: array is 0-dimensional, but 1 were indexed