taesungp / contrastive-unpaired-translation

Contrastive unpaired image-to-image translation, faster and lighter training than cyclegan (ECCV 2020, in PyTorch)
https://taesung.me/ContrastiveUnpairedTranslation/
Other
2.23k stars 417 forks source link

Problems about image size #98

Open zmj876902008 opened 3 years ago

zmj876902008 commented 3 years ago

Hello, I want to ask how to keep the input and output size of image unchanged. I need to input a 480 * 640 image set for training and testing. Looking forward to your reply soon!

taesungp commented 3 years ago

In order to skip the default preprocessing method of resizing and random cropping, you can use --preprocess none option.

hepei03 commented 2 years ago

In order to skip the default preprocessing method of resizing and random cropping, you can use --preprocess none option.

Hi, thanks for sharing this useful open source. I met a problem when setting --preprocess none . Any suggestions to this?

/usr/local/lib/python3.7/dist-packages/visdom/init.py:366: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray. return np.array(a) Traceback (most recent call last): File "train.py", line 55, in visualizer.display_current_results(model.get_current_visuals(), epoch, save_result) File "/content/CUT/util/visualizer.py", line 146, in display_current_results None, dict(title=title + ' images')) File "/usr/local/lib/python3.7/dist-packages/visdom/init.py", line 389, in wrapped_f return f(*args, **kwargs) File "/usr/local/lib/python3.7/dist-packages/visdom/init.py", line 387, in args = (_to_numpy(arg) for arg in args) File "/usr/local/lib/python3.7/dist-packages/visdom/init.py", line 366, in _to_numpy return np.array(a) ValueError: could not broadcast input array from shape (3,76,348) into shape (3,)