Hello, I am implementing cycleGans
with my own dataset. I have written my own dataset loader and in cyclegan.py line 120: i have changed it as
Training data loader
train_dataloader = DataLoader(
MyDataset(train_A_dataset ,train_B_dataset),
#batch_size=opt.batch_size,
batch_size=opt.batch_size,
shuffle=True,
num_workers=opt.n_cpu
and in line 161 :
r epoch in range(opt.epoch, opt.n_epochs):
for i, batch in enumerate(train_dataloader):
I am running the code on CPU .
I get this error
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
Traceback (most recent call last):
File “C:\Users\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py”, line 761, in _try_get_data
data = self._data_queue.get(timeout=timeout)
File “C:\Users\Anaconda3\lib\multiprocessing\queues.py”, line 105, in get
raise Empty
queue.Empty
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “E:/example/cyclegan.py”, line 161, in
for i, batch in enumerate(train_dataloader):
File “C:\Users\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py”, line 345, in next
data = self._next_data()
File “C:\Users\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py”, line 841, in _next_data
idx, data = self._get_data()
File “C:\Users\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py”, line 808, in _get_data
success, data = self._try_get_data()
File “C:\Users\Surbhi\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py”, line 774, in _try_get_data
raise RuntimeError(‘DataLoader worker (pid(s) {}) exited unexpectedly’.format(pids_str))
RuntimeError: DataLoader worker (pid(s) 30412, 26524, 28704, 10456, 30900) exited unexpectedly
I do not understand what is the cause of this error. Also , I do not have the directory of input data in the folder . I created the patches, saved them in the memory and wrote the dataloader.