Closed Easyfeng222 closed 5 years ago
This code just supports Pytorch0.3.1, Pytorch0.4 changes lots of APIs and something in this code is not applicable. Maybe your python version is low? We use python3.6.
@chanyn I upgrade my python3.5 to python3.6,Very unfortunate, the problem remains.
wrote gt roidb to /home/feng/HKRM/data/Detection/cache/ade_train_5_gt_roidb.pkl
wrote gt image to /home/feng/HKRM/data/Detection/cache/ade_train_5_gt_image.pkl
done
Preparing training data...
done
before filtering, there are 40420 images...
after filtering, there are 40394 images...
40394 roidb entries
loading initial baseline model /home/feng/HKRM/save1/ade_faster_rcnn.pth
Traceback (most recent call last):
File "trainval_HKRM.py", line 300, in
When I use pytorch0.3.1 Appending horizontally-flipped training examples... ade_train_5 gt roidb loaded from /home/feng/HKRM/data/Detection/cache/ade_train_5_gt_roidb.pkl ade_train_5 gt image loaded from /home/feng/HKRM/data/Detection/cache/ade_train_5_gt_image.pkl done Preparing training data... done before filtering, there are 40420 images... after filtering, there are 40394 images... 40394 roidb entries loading initial baseline model /home/feng/HKRM/save1/ade_faster_rcnn.pth Traceback (most recent call last): File "trainval_HKRM.py", line 300, in
checkpoint = torch.load(load_name)
File "/home/feng/.local/lib/python3.5/site-packages/torch/serialization.py", line 267, in load
return _load(f, map_location, pickle_module)
File "/home/feng/.local/lib/python3.5/site-packages/torch/serialization.py", line 420, in _load
result = unpickler.load()
AttributeError: Can't get attribute '_rebuild_tensor_v2' on <module 'torch._utils' from '/home/feng/.local/lib/python3.5/site-packages/torch/_utils.py'>
After google,I find it version too low.so I upgrade my pytorch==0.4.0,raising other problem: successfully loaded baseline model /home/feng/HKRM/save1/ade_faster_rcnn.pth", line 969, in _find_and_load", line 954, in _find_and_load_unlocked", line 887, in _find_spec
Traceback (most recent call last):
File "trainval_HKRM.py", line 356, in
rois_label, adja_loss, adjr_loss = fasterRCNN(im_data, im_info, gt_boxes, num_boxes)
File "/home/feng/.local/lib/python3.5/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, kwargs)
File "/home/feng/HKRM/lib/model/HKRM/faster_rcnn_HKRM.py", line 160, in forward
rois, output_cls_score, rpn_loss_cls, rpn_loss_bbox = self.RCNN_rpn(base_feat, im_info, gt_boxes, num_boxes)
File "/home/feng/.local/lib/python3.5/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, *kwargs)
File "/home/feng/HKRM/lib/model/rpn/rpn_region.py", line 78, in forward
im_info, cfg_key))
File "/home/feng/.local/lib/python3.5/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(input, kwargs)
File "/home/feng/HKRM/lib/model/rpn/proposal_layer_region.py", line 162, in forward
output_cls_score[i,:num_proposal,1] = scores_single
RuntimeError: expand(torch.cuda.FloatTensor{[2000, 1]}, size=[2000]): the number of sizes provided (1) must be greater or equal to the number of dimensions in the tensor (2)
Exception ignored in: <bound method _DataLoaderIter.del of <torch.utils.data.dataloader._DataLoaderIter object at 0x7f15f6816080>>
Traceback (most recent call last):
File "/home/feng/.local/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 349, in del
File "/home/feng/.local/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 328, in _shutdown_workers
File "/usr/lib/python3.5/multiprocessing/queues.py", line 345, in get
File "
File "
File "
TypeError: 'NoneType' object is not iterable
After google ,may be version is high??