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

AttributeError: module 'numpy' has no attribute 'range' #12

Open
byronsit opened this issue Dec 14, 2023 · 0 comments
Open

AttributeError: module 'numpy' has no attribute 'range' #12

byronsit opened this issue Dec 14, 2023 · 0 comments

Comments

@byronsit
Copy link

为啥我的numpy没有range函数呢
PVO/VO_Module/droid_slam
/droid_net.py

里面有一个 lay = torch.as_tensor(np.range(1, num+1).repeat(ht*wd).reshape(num,ht,wd)).unsqueeze(0)
会让我报错。

我试着直接写再我的python里试图调用numpy.range,确实不太work

这是我跑到sh tools/test_vo_scene.sh 的时候报的错误。之后还报了若干个类似

Traceback (most recent call last):
  File "VO_Module/evaluation_scripts/test_vo2.py", line 93, in <module>
    for i_batch, item in enumerate(train_loader):
  File "/home/xbh/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 630, in __next__
    data = self._next_data()
  File "/home/xbh/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1345, in _next_data
    return self._process_data(data)
  File "/home/xbh/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1371, in _process_data
    data.reraise()
  File "/home/xbh/.local/lib/python3.8/site-packages/torch/_utils.py", line 694, in reraise
    raise exception
IndexError: Caught IndexError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "/home/xbh/.local/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop
    data = fetcher.fetch(index)
  File "/home/xbh/.local/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 51, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/xbh/.local/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 51, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/xbh/.local/lib/python3.8/site-packages/torch/utils/data/dataset.py", line 302, in __getitem__
    return self.datasets[dataset_idx][sample_idx]
  File "/home/xbh/TIM/PVO/PVO/VO_Module/droid_slam/data_readers/base.py", line 201, in __getitem__
    mask, v = self.__class__.dymask_read(dymask_list[i])
IndexError: list index out of range

这样的错误

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

1 participant