liutinglt / CE2P

214 stars 41 forks source link

Error when running job_train.sh #20

Open TuanHAnhVN opened 5 years ago

TuanHAnhVN commented 5 years ago

I have met the following error when running job_train.sh:

File "train.py", line 173, in main for i_iter, batch in enumerate(trainloader): File "/home/tuanha/.virtualenvs/dmp_workspace/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 281, in next return self._process_next_batch(batch) File "/home/tuanha/.virtualenvs/dmp_workspace/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 301, in _process_next_batch raise batch.exc_type(batch.exc_msg) RuntimeError: Traceback (most recent call last): File "/home/tuanha/.virtualenvs/dmp_workspace/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 55, in _worker_loop samples = collate_fn([dataset[i] for i in batch_indices]) File "/home/tuanha/.virtualenvs/dmp_workspace/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 135, in default_collate return [default_collate(samples) for samples in transposed] File "/home/tuanha/.virtualenvs/dmp_workspace/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 135, in return [default_collate(samples) for samples in transposed] File "/home/tuanha/.virtualenvs/dmp_workspace/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 121, in default_collate return torch.stack([torch.from_numpy(b) for b in batch], 0) File "/home/tuanha/.virtualenvs/dmp_workspace/lib/python3.6/site-packages/torch/functional.py", line 64, in stack return torch.cat(inputs, dim) RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0. Got 473 and 467 in dimension 1 at /pytorch/torch/lib/TH/generic/THTensorMath.c:2897

Help me, please! Thank you so much!

TuanHAnhVN commented 5 years ago

I passed this error. I think caused by loading data in the wrong way. I edited code by my way.

huangxi6 commented 5 years ago

@hoanganhtuanfsoft I also met a error similar to yours, so I want to know how you edited it, thank you!

TuanHAnhVN commented 5 years ago

@huangxi6 you must resize edge’s image before returning. I don’t know what problem if use it but i pass it and train successfully

huangxi6 commented 5 years ago

@hoanganhtuanfsoft Thank you, I'll try that.

TuanHAnhVN commented 5 years ago

@huangxi6 can you show result after running successfully?

huangxi6 commented 5 years ago

@hoanganhtuanfsoft Due to the relocation of our laboratory, I can not run this code now. But I can show result if I run it successfully. Then, I want to know how many GPUs you use, and are your results the same as the author's?

liutinglt commented 5 years ago

@hoanganhtuanfsoft @huangxi6 Please use the updated code, the edge is generated automatically.