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

Add .map_data after DictMappers in test_run_transformers_DC2.py #72

Merged
merged 1 commit into from
Dec 5, 2023

Conversation

OliviaLynn
Copy link
Member

For #17

Without the .map_datas, running this would give:

ERROR [12/05 09:50:52 d2.engine.train_loop]: Exception during training:
Traceback (most recent call last):
  File "/home/olynn/detectron2/detectron2/engine/train_loop.py", line 155, in train
    self.run_step()
  File "/home/olynn/deepdisc/src/deepdisc/training/trainers.py", line 52, in run_step
    data = next(self._data_loader_iter)
  File "/home/olynn/detectron2/detectron2/data/common.py", line 329, in __iter__
    for d in self.dataset:
  File "/home/olynn/.conda/envs/ddr/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 628, in __next__
    data = self._next_data()
  File "/home/olynn/.conda/envs/ddr/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 1333, in _next_data
    return self._process_data(data)
  File "/home/olynn/.conda/envs/ddr/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 1359, in _process_data
    data.reraise()
  File "/home/olynn/.conda/envs/ddr/lib/python3.9/site-packages/torch/_utils.py", line 543, in reraise
    raise exception
TypeError: Caught TypeError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "/home/olynn/.conda/envs/ddr/lib/python3.9/site-packages/torch/utils/data/_utils/worker.py", line 302, in _worker_loop
    data = fetcher.fetch(index)
  File "/home/olynn/.conda/envs/ddr/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 34, in fetch
    data.append(next(self.dataset_iter))
  File "/home/olynn/detectron2/detectron2/data/common.py", line 296, in __iter__
    yield self.dataset[idx]
  File "/home/olynn/detectron2/detectron2/data/common.py", line 125, in __getitem__
    data = self._map_func(self._dataset[cur_idx])
  File "/home/olynn/detectron2/detectron2/utils/serialize.py", line 26, in __call__
    return self._obj(*args, **kwargs)
TypeError: 'DictMapper' object is not callable

saving Swin_test
Traceback (most recent call last):
  File "/home/olynn/deepdisc/test_run_transformers_DC2.py", line 190, in <module>
    launch(
  File "/home/olynn/detectron2/detectron2/engine/launch.py", line 84, in launch
    main_func(*args)
  File "/home/olynn/deepdisc/test_run_transformers_DC2.py", line 176, in main
    trainer.train(0, 20)
  File "/home/olynn/detectron2/detectron2/engine/train_loop.py", line 155, in train
    self.run_step()
  File "/home/olynn/deepdisc/src/deepdisc/training/trainers.py", line 52, in run_step
    data = next(self._data_loader_iter)
  File "/home/olynn/detectron2/detectron2/data/common.py", line 329, in __iter__
    for d in self.dataset:
  File "/home/olynn/.conda/envs/ddr/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 628, in __next__
    data = self._next_data()
  File "/home/olynn/.conda/envs/ddr/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 1333, in _next_data
    return self._process_data(data)
  File "/home/olynn/.conda/envs/ddr/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 1359, in _process_data
    data.reraise()
  File "/home/olynn/.conda/envs/ddr/lib/python3.9/site-packages/torch/_utils.py", line 543, in reraise
    raise exception
TypeError: Caught TypeError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "/home/olynn/.conda/envs/ddr/lib/python3.9/site-packages/torch/utils/data/_utils/worker.py", line 302, in _worker_loop
    data = fetcher.fetch(index)
  File "/home/olynn/.conda/envs/ddr/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 34, in fetch
    data.append(next(self.dataset_iter))
  File "/home/olynn/detectron2/detectron2/data/common.py", line 296, in __iter__
    yield self.dataset[idx]
  File "/home/olynn/detectron2/detectron2/data/common.py", line 125, in __getitem__
    data = self._map_func(self._dataset[cur_idx])
  File "/home/olynn/detectron2/detectron2/utils/serialize.py", line 26, in __call__
    return self._obj(*args, **kwargs)
TypeError: 'DictMapper' object is not callable

Copy link

codecov bot commented Dec 5, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (eccedb4) 12.83% compared to head (2cc6064) 12.83%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #72   +/-   ##
=======================================
  Coverage   12.83%   12.83%           
=======================================
  Files          22       22           
  Lines        3458     3458           
=======================================
  Hits          444      444           
  Misses       3014     3014           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@OliviaLynn OliviaLynn mentioned this pull request Dec 5, 2023
Copy link
Collaborator

@drewoldag drewoldag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty reasonable to me.

@OliviaLynn OliviaLynn merged commit 0dc484d into main Dec 5, 2023
4 checks passed
@OliviaLynn OliviaLynn deleted the issue/16/dictmapper branch December 13, 2023 14:06
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

Successfully merging this pull request may close these issues.

2 participants