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

A problem will occur when I training this model #84

Open
Mr-doraemon opened this issue Nov 24, 2020 · 0 comments
Open

A problem will occur when I training this model #84

Mr-doraemon opened this issue Nov 24, 2020 · 0 comments

Comments

@Mr-doraemon
Copy link

when I run the code python train.py part_A_train.json part_A_test.json 0 0, an error will occur. The detial about this error is:

/home/user/.local/lib/python2.7/site-packages/torch/nn/_reduction.py:49: UserWarning: size_average and reduce args will be deprecated, please use reduction='sum' instead.
warnings.warn(warning.format(ret))
epoch 0, processed 0 samples, lr 0.0000001000
/home/user/CSRNet/image.py:14: H5pyDeprecationWarning: The default file mode will change to 'r' (read-only) in h5py 3.0. To suppress this warning, pass the mode you need to h5py.File(), or set the global default h5.get_config().default_file_mode, or set the environment variable H5PY_DEFAULT_READONLY=1. Available modes are: 'r', 'r+', 'w', 'w-'/'x', 'a'. See the docs for details.
gt_file = h5py.File(gt_path)
Traceback (most recent call last):
File "train.py", line 230, in
main()
File "train.py", line 92, in main
train(train_list, model, criterion, optimizer, epoch)
File "train.py", line 131, in train
for i,(img, target)in enumerate(train_loader):
File "/home/user/.local/lib/python2.7/site-packages/torch/utils/data/dataloader.py", line 615, in next
batch = self.collate_fn([self.dataset[i] for i in indices])
File "/home/user/CSRNet/dataset.py", line 33, in getitem
img,target = load_data(img_path,self.train)
File "/home/user/CSRNet/image.py", line 15, in load_data
print(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 "/home/user/anaconda3/envs/CSRNet/lib/python2.7/site-packages/h5py/_hl/group.py", line 264, 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)"

I'm looking forward to your relpy!

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