Closed Hanzy1996 closed 6 years ago
please try inserting train_kwargs['root'] = str(train_kwargs['root'])
before train_data = dset(**train_kwargs)
in dataset.py
and see if it solves the problem
I replaced pathlib
module with os
and now I guess the above issue will not happen anymore. but if you still find any problem regarding this, please let me know. thanks.
Thanks a lot. I am downloading the datasets and will retry later.MUCH appreciation for replying timely.
It seems pathlib works better. I retry the code I downloaded yesterday on the server with python 2, and it is going well. But the code, in which you said you replaced pathlib module with os, I downloaded today has other bug. The bug still exists after I inserted train_kwargs['root'] = str(train_kwargs['root']) before train_data = dset(**train_kwargs) in dataset.py.
Traceback (most recent call last):
File "/root/anaconda2/lib/python2.7/site-packages/visdom/init.py", line 446, in _send
data=json.dumps(msg),
File "/root/anaconda2/lib/python2.7/site-packages/requests/api.py", line 110, in post
return request('post', url, data=data, json=json, kwargs)
File "/root/anaconda2/lib/python2.7/site-packages/requests/api.py", line 56, in request
return session.request(method=method, url=url, kwargs)
File "/root/anaconda2/lib/python2.7/site-packages/requests/sessions.py", line 488, in request
resp = self.send(prep, send_kwargs)
File "/root/anaconda2/lib/python2.7/site-packages/requests/sessions.py", line 609, in send
r = adapter.send(request, kwargs)
File "/root/anaconda2/lib/python2.7/site-packages/requests/adapters.py", line 487, in send
raise ConnectionError(e, request=request)
ConnectionError: HTTPConnectionPool(host='localhost', port=8097): Max retries exceeded with url: /env/main (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f6578fb9c50>: Failed to establish a new connection: [Errno 111] Connection refused',))
No handlers could be found for logger "visdom"
Traceback (most recent call last):
File "main.py", line 69, in
Maybe pathlib with inserting train_kwargs['root'] = str(train_kwargs['root']) is a better choice.
are you using python2? I think your python version makes the problem. It seems that keyword argument 'exist_ok' is supported only in python3, but not in python2.
https://docs.python.org/2/library/os.html#os.makedirs https://docs.python.org/3/library/os.html#os.makedirs
Thanks so much. It finally works and I get the results after 8 hours' trainning.
Great! closing for now.
/home/hanzy/PyPro/GANandVAE/Beta-VAE-master/model.py:150: UserWarning: nn.init.kaiming_normal is now deprecated in favor of nn.init.kaimingnormal. init.kaiming_normal(m.weight) unorderable types: float() > NoneType() unorderable types: float() > NoneType() unorderable types: float() > NoneType() Visdom python client failed to establish socket to get messages from the server. This feature is optional and can be disabled by initializing Visdom with
main(args)
File "/home/hanzy/PyPro/GANandVAE/Beta-VAE-master/main.py", line 21, in main
net = Solver(args)
File "/home/hanzy/PyPro/GANandVAE/Beta-VAE-master/solver.py", line 140, in init
self.data_loader = return_data(args)
File "/home/hanzy/PyPro/GANandVAE/Beta-VAE-master/dataset.py", line 80, in return_data
train_data = dset(**train_kwargs)
File "/home/hanzy/PyPro/GANandVAE/Beta-VAE-master/dataset.py", line 18, in init
super(CustomImageFolder, self).init(root, transform)
File "/usr/local/lib/python3.5/dist-packages/torchvision/datasets/folder.py", line 99, in init
classes, class_to_idx = find_classes(root)
File "/usr/local/lib/python3.5/dist-packages/torchvision/datasets/folder.py", line 24, in find_classes
classes = [d for d in os.listdir(dir) if os.path.isdir(os.path.join(dir, d))]
TypeError: argument should be string, bytes or integer, not PosixPath
use_incoming_socket=False
, which will prevent waiting for this request to timeout. => no checkpoint found at 'checkpoints/main/last' Traceback (most recent call last): File "/home/hanzy/PyPro/GANandVAE/Beta-VAE-master/main.py", line 69, in