leeyeehoo / CSRNet-pytorch

CSRNet: Dilated Convolutional Neural Networks for Understanding the Highly Congested Scenes
647 stars 261 forks source link

train.py error #64

Closed RickStor closed 4 years ago

RickStor commented 4 years ago

Hi, when I try train.py I got this error:


> Traceback (most recent call last):
>   File "/content/gdrive/My Drive/Colab Notebooks/Projetos/CSRNet-pytorch/train.py", line 230, in <module>
>     main()        
>   File "/content/gdrive/My Drive/Colab Notebooks/Projetos/CSRNet-pytorch/train.py", line 92, in main
>     train(train_list, model, criterion, optimizer, epoch)
>   File "/content/gdrive/My Drive/Colab Notebooks/Projetos/CSRNet-pytorch/train.py", line 131, in train
>     for i,(img, target)in enumerate(train_loader):
>   File "/usr/local/lib/python2.7/dist-packages/torch/utils/data/dataloader.py", line 346, in __next__
>     data = self._dataset_fetcher.fetch(index)  # may raise StopIteration
>   File "/usr/local/lib/python2.7/dist-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
>     data = [self.dataset[idx] for idx in possibly_batched_index]
>   File "/content/gdrive/My Drive/Colab Notebooks/Projetos/CSRNet-pytorch/dataset.py", line 33, in __getitem__
>     img,target = load_data(img_path,self.train)
>   File "/content/gdrive/My Drive/Colab Notebooks/Projetos/CSRNet-pytorch/image.py", line 13, in load_data
>     target = np.asarray(gt_file['density'])
>   File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
>   File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
>   File "/usr/local/lib/python2.7/dist-packages/h5py/_hl/group.py", line 177, in __getitem__
>     oid = h5o.open(self.id, self._e(name), lapl=self._lapl)
>   File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
>   File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
>   File "h5py/h5o.pyx", line 190, in h5py.h5o.open
> KeyError: "Unable to open object (object 'density' doesn't exist)"

How can I solve this issue?

ayushmaan-IIITD commented 4 years ago

I am facing the same error while running on Google collab. How to resolve this?

joseantoniovz1 commented 4 years ago

How did you solve that issue? i'm facing with it. i'm trying to implement the project in colab.

aannn555 commented 4 years ago

have you fixed this problem yet?

How did you solve that issue? i'm facing with it. i'm trying to implement the project in colab.