contrastive-unpaired-translation icon indicating copy to clipboard operation
contrastive-unpaired-translation copied to clipboard

Can this code run on Windows

Open wangjt1216 opened this issue 4 years ago • 5 comments

wangjt1216 avatar Nov 03 '20 01:11 wangjt1216

code runs perfectly (on W10)

dr-benway avatar Nov 03 '20 19:11 dr-benway

code runs perfectly (on W10)

Hello, dr

I test this code in ubuntu and it works pretty well, but when I try it on win10 with the same python env, i meet some problem:

`Could not connect to Visdom server. Trying to start a server.... Command: D:\SDKs\Python\Anaconda\envs\cut\python.exe -m visdom.server -p 8097 &>/dev/null & create web directory ./checkpoints\singleimage_monet_etretat\web... Traceback (most recent call last): File "train.py", line 31, in for i, data in enumerate(dataset): # inner loop within one epoch File "D:\Code\Python\CUT\data_init_.py", line 95, in iter for i, data in enumerate(self.dataloader): File "D:\SDKs\Python\Anaconda\envs\cut\lib\site-packages\torch\utils\data\dataloader.py", line 278, in iter return _MultiProcessingDataLoaderIter(self) File "D:\SDKs\Python\Anaconda\envs\cut\lib\site-packages\torch\utils\data\dataloader.py", line 682, in init w.start() File "D:\SDKs\Python\Anaconda\envs\cut\lib\multiprocessing\process.py", line 112, in start self._popen = self._Popen(self) File "D:\SDKs\Python\Anaconda\envs\cut\lib\multiprocessing\context.py", line 223, in _Popen return _default_context.get_context().Process._Popen(process_obj) File "D:\SDKs\Python\Anaconda\envs\cut\lib\multiprocessing\context.py", line 322, in _Popen return Popen(process_obj) File "D:\SDKs\Python\Anaconda\envs\cut\lib\multiprocessing\popen_spawn_win32.py", line 89, in init reduction.dump(process_obj, to_child) File "D:\SDKs\Python\Anaconda\envs\cut\lib\multiprocessing\reduction.py", line 60, in dump ForkingPickler(file, protocol).dump(obj) AttributeError: Can't pickle local object 'pytorch_wrap..result'

(cut) D:\Code\Python\CUT>Traceback (most recent call last): File "", line 1, in File "D:\SDKs\Python\Anaconda\envs\cut\lib\multiprocessing\spawn.py", line 105, in spawn_main exitcode = _main(fd) File "D:\SDKs\Python\Anaconda\envs\cut\lib\multiprocessing\spawn.py", line 115, in _main self = reduction.pickle.load(from_parent) EOFError: Ran out of input`

Python envs: Python = 3.6.12 pytorch=1.4.0 torchvision==0.5.0 visdom==0.1.8 packaging GPUtil==1.4.0

it seems to visdom does not work well. Could you please tell me how to solve this problem? Thanks!

pureYioYi avatar Dec 08 '20 02:12 pureYioYi

I had the same problem. It's related to pytorch windows thread issues. To solve go to data/__init__.py and change the number of worker threads (line 79).

            self.dataset,
            batch_size=opt.batch_size,
            shuffle=not opt.serial_batches,
            # num_workers=int(opt.num_threads), This is the problem, change it to 0
            num_workers = int(0), 
            drop_last=True if opt.isTrain else False,`

Steedalion avatar Dec 17 '20 00:12 Steedalion

Duplicate of #37

Steedalion avatar Dec 17 '20 01:12 Steedalion

I had the same problem. It's related to pytorch windows thread issues. To solve go to data/__init__.py and change the number of worker threads (line 79).

            self.dataset,
            batch_size=opt.batch_size,
            shuffle=not opt.serial_batches,
            # num_workers=int(opt.num_threads), This is the problem, change it to 0
            num_workers = int(0), 
            drop_last=True if opt.isTrain else False,`

Thanks! Solved!

pureYioYi avatar Dec 17 '20 10:12 pureYioYi