Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error that shouldn't have occurred #106

Open
littleblackzi opened this issue Nov 21, 2024 · 1 comment
Open

An error that shouldn't have occurred #106

littleblackzi opened this issue Nov 21, 2024 · 1 comment

Comments

@littleblackzi
Copy link

I completely understand the meaning of this code, but it reported an error, when I changed data = data[:, :, 0] to data = data[:, :], the error was gone.But I know I can't change it that way.
image
Log as follows:
/home/oem/anaconda3/envs/interfuser/lib/python3.7/site-packages/torch/distributed/launch.py:188: FutureWarning: The module torch.distributed.launch is deprecated
and will be removed in future. Use torchrun.
Note that --use_env is set by default in torchrun.
If your script expects --local_rank argument to be set, please
change it to read from os.environ['LOCAL_RANK'] instead. See
https://pytorch.org/docs/stable/distributed.html#launch-utility for
further instructions

FutureWarning,
Training with a single process on 1 GPUs.
Loading pretrained weights from url (https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/resnet50d_ra2-464e36ba.pth)
Model interfuser_baseline created, param count:52935567
Data processing configuration for current model + dataset:
input_size: (3, 224, 224)
interpolation: bicubic
mean: (0.485, 0.456, 0.406)
std: (0.229, 0.224, 0.225)
crop_pct: 0.875
CNN backbone and transformer blocks using different learning rates!
165 weights in the cnn backbone, 274 weights in other modules
AMP not enabled. Training in float32.
Scheduled epochs: 35
Sub route dir nums: 1628
Sub route dir nums: 73
Traceback (most recent call last):
File "train.py", line 1831, in
main()
File "train.py", line 1241, in main
mixup_fn=mixup_fn,
File "train.py", line 1339, in train_one_epoch
for batch_idx, (input, target) in enumerate(loader):
File "/home/oem/anaconda3/envs/interfuser/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 628, in next
data = self._next_data()
File "/home/oem/anaconda3/envs/interfuser/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1333, in _next_data
return self._process_data(data)
File "/home/oem/anaconda3/envs/interfuser/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1359, in _process_data
data.reraise()
File "/home/oem/anaconda3/envs/interfuser/lib/python3.7/site-packages/torch/_utils.py", line 543, in reraise
raise exception
IndexError: Caught IndexError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/home/oem/anaconda3/envs/interfuser/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 302, in _worker_loop
data = fetcher.fetch(index)
File "/home/oem/anaconda3/envs/interfuser/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 58, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/oem/anaconda3/envs/interfuser/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 58, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/oem/InterFuser/interfuser/timm/data/carla_dataset.py", line 312, in getitem
seg_image = self.seg_transform(seg_image)
File "/home/oem/anaconda3/envs/interfuser/lib/python3.7/site-packages/torchvision/transforms/transforms.py", line 95, in call
img = t(img)
File "/home/oem/InterFuser/interfuser/timm/data/transforms_carla_factory.py", line 44, in call
data = data[:, :, 0]
IndexError: too many indices for array
Do you have any suggestions about this?

@deepcs233
Copy link
Collaborator

deepcs233 commented Nov 25, 2024

Hi!

In the released code, we didn't involve the segmentation input. So we didn't check the related code and function. Can you print the shape of data? If data is a 2D array, I think the removal of the last 0 is fine.

File "/home/oem/InterFuser/interfuser/timm/data/transforms_carla_factory.py", line 44, in call
data = data[:, :, 0]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants