sshan-zhao / GASDA

Geometry-Aware Symmetric Domain Adaptation for Monocular Depth Estimation, CVPR 2019
133 stars 23 forks source link

train problem #18

Closed chongagp closed 2 years ago

chongagp commented 2 years ago

training stage (epoch: 1) starting.................... Traceback (most recent call last): File "/home/gp/GASDA/CODE/train.py", line 35, in for ind, data in enumerate(train_data_loader): File "/home/gp/anaconda3/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 435, in next data = self._next_data() File "/home/gp/anaconda3/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1085, in _next_data return self._process_data(data) File "/home/gp/anaconda3/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1111, in _process_data data.reraise() File "/home/gp/anaconda3/lib/python3.8/site-packages/torch/_utils.py", line 428, in reraise raise self.exc_type(msg) TypeError: Caught TypeError in DataLoader worker process 0. Original Traceback (most recent call last): File "/home/gp/anaconda3/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 198, in _worker_loop data = fetcher.fetch(index) File "/home/gp/anaconda3/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/gp/anaconda3/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 44, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/gp/GASDA/CODE/data/datasets.py", line 22, in getitem {dd.update(d[i]) for d in self.datasets if d is not None} File "/home/gp/GASDA/CODE/data/datasets.py", line 22, in {dd.update(d[i]) for d in self.datasets if d is not None} File "/home/gp/GASDA/CODE/data/datasets.py", line 160, in getitem l_img, rimg, , fb = self.joint_transform((l_img, r_img, None, 'train', fb)) File "/home/gp/anaconda3/lib/python3.8/site-packages/torchvision/transforms/transforms.py", line 67, in call img = t(img) File "/home/gp/GASDA/CODE/data/transform.py", line 122, in call scale = float(self.size[1]) / float(w0) TypeError: 'int' object is not subscriptable

Hello author, I would like to ask what is the reason for the error shown above during my training?

sshan-zhao commented 2 years ago

Did you organize the files correctly?

chongagp commented 2 years ago

yes,I downloaded the entire raw data set from kitti's official website and placed it directly in the kitti folder in datasets, and downloaded the vkitti data set under the link you gave, and classified them into rgb and depth folder。

chongagp commented 2 years ago

Did you organize the files correctly? Is it possible that my cuda version is too high (11.1)? Can the code run on this version (python=3.8, pytorch=1.7, torchvision=0.82), I also run on python=3.6, pytorch=0.41, torchvision=0.21cuda=11.1, and I still get the same error

sshan-zhao commented 2 years ago

"scale = float(self.size[1]) / float(w0) TypeError: 'int' object is not subscriptable". Maybe you should check self.size

chongagp commented 2 years ago

i don't know what this mean :(if self.size == [-1]),you set size always 286(parser.add_argument('--loadSize', nargs='+', type=int, default=286, help='scale images to this size').Therefore, the result of this judgment is always wrong, so the following code will not proceed. , when i change this code to :if self.size. then,The above error is no longer reported .

sshan-zhao commented 2 years ago

--loadSize xx xx, do not use the default setting.

chongagp commented 2 years ago

--loadSize xx xx, do not use the default setting.

sorry,could you explain in a little more detail ?I still can't fully understand ,You told me not to use the default value. so what value should I use?when will size==[-1] be established and what is its function?

sshan-zhao commented 2 years ago

--loadSize xx xx, do not use the default setting.

sorry,could you explain in a little more detail ?I still can't fully understand ,You told me not to use the default value. so what value should I use?when will size==[-1] be established and what is its function?

python train.py --model ft --gpu_ids 0 --batchSize 8 --loadSize 256 1024 --g_tgt_premodel ./cyclegan/G_Tgt.pth

chongagp commented 2 years ago

ok thanks!