deepglugs / dalle

8 stars 4 forks source link

UnboundLocalError: local variable 'clip' #2

Closed skywo1f closed 3 years ago

skywo1f commented 3 years ago

I was able to train the vae, but I am now stuck on the dalle training step. It is telling me: loading state dict from vae.pt preloading txt files... processing 72496/72496 done preloading txt onehots Train Epoch: 1 [0/72496 (0%)] Loss: 0.569296 Traceback (most recent call last): File "dalle.py", line 615, in main() File "dalle.py", line 608, in main train_dalle(vae, args) File "dalle.py", line 331, in train_dalle if clip is not None: UnboundLocalError: local variable 'clip' referenced before assignment

deepglugs commented 3 years ago

should be fixed with https://github.com/deepglugs/dalle/commit/36ee7eba025c11e0d243d7fd369cec44727210e8

skywo1f commented 3 years ago

seems to have fixed the problem, though now I am getting a new problem:

~/neural-nets/dalle$ ./train.sh loading state dict from vae.pt preloading txt files... processing 72496/72496 done preloading txt onehots could not find 94839-004-61CB5BCA in preloaded txts Traceback (most recent call last): File "dalle.py", line 617, in main() File "dalle.py", line 610, in main train_dalle(vae, args) File "dalle.py", line 299, in train_dalle for image, labels in dl: File "/home/iviti/.local/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 435, in next data = self._next_data() File "/home/iviti/.local/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/home/iviti/.local/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 47, in fetch return self.collate_fn(data) File "/home/iviti/.local/lib/python3.6/site-packages/torch/utils/data/_utils/collate.py", line 80, in default_collate if not all(len(elem) == elem_size for elem in it): File "/home/iviti/.local/lib/python3.6/site-packages/torch/utils/data/_utils/collate.py", line 80, in if not all(len(elem) == elem_size for elem in it): TypeError: object of type 'NoneType' has no len()

deepglugs commented 3 years ago

this is usually caused by having image files without a corresponding text file. For example there is a 94839-004-61CB5BCA.png without a 94839-004-61CB5BCA.txt.

skywo1f commented 3 years ago

It says it right there haha. I should probably learn to read.