san icon indicating copy to clipboard operation
san copied to clipboard

about train

Open kkk241-q opened this issue 3 years ago • 4 comments

May I ask you about this error?

I'd appreciate it if you could let me know.

$ python train_slr.py

Start Time: 2021-03-09-21.23

Putting log in EXPERIMENTATIONS/2021-03-09-21.23 Training CNN-attention-CTC on GPU! Dataset sizes: {'train': 5672, 'valid': 540} vocabulary size:1233 None False False False

Training using 1.py device (GPU/CPU), use very small batch_size! Loading to GPUs | ID | GPU | MEM |

| 0 | 3% | 15% | | 1 | 0% | 0% | None No scheduler!

EPOCH 0 ------------------ After train epoch.. | ID | GPU | MEM |

| 0 | 3% | 15% | | 1 | 0% | 0% | None Evaluating.. Traceback (most recent call last): File "/home/jygim/Workspace/SAN/train_slr.py", line 642, in val_loss, word_err = run_epoch(model, valid_dataloader) File "/home/jygim/Workspace/SAN/train_slr.py", line 261, in run_epoch for step, (x, x_lengths, y, y_lengths, hand_regions, hand_lengths) in enumerate(data): File "/home/jygim/miniconda3/envs/san/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 345, in next data = self._next_data() File "/home/jygim/miniconda3/envs/san/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 856, in _next_data return self._process_data(data) File "/home/jygim/miniconda3/envs/san/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 881, in _process_data data.reraise() File "/home/jygim/miniconda3/envs/san/lib/python3.6/site-packages/torch/_utils.py", line 394, in reraise raise self.exc_type(msg) UnboundLocalError: Caught UnboundLocalError in DataLoader worker process 0. Original Traceback (most recent call last): File "/home/jygim/miniconda3/envs/san/lib/python3.6/site-packages/torch/utils/data/_utils/worker.py", line 178, in _worker_loop data = fetcher.fetch(index) File "/home/jygim/miniconda3/envs/san/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/jygim/miniconda3/envs/san/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/jygim/Workspace/SAN/dataloader_slr.py", line 180, in getitem sample = {'images': trsf_images, 'right_hands':hand_images, 'translation': trans} UnboundLocalError: local variable 'trsf_images' referenced before assignment

kkk241-q avatar Jul 13 '21 13:07 kkk241-q

I am very sorry for the late response. I am aware of these type of problems that have been produced after migrating the code. I was busy lately with work so i didn't have time to clean and fix the code errors. Hopefully in the next few weeks i will get back to it. Thank you for your understanding :)

faresbs avatar Aug 05 '21 14:08 faresbs

请问是怎么解决这个问题的,遇到同样的问题了

lemo366 avatar Dec 27 '21 12:12 lemo366

I have the same problem,is it resolved now?

fengjiasun avatar Nov 18 '22 03:11 fengjiasun

I encountered the same issue. Has it been resolved now?

youthxin avatar Nov 06 '23 04:11 youthxin