hyseob / PyMDNet

MDNet PyTorch implementation
Other
420 stars 150 forks source link

'tuple' object has no attribute 'size' #25

Open Gyiming opened 5 years ago

Gyiming commented 5 years ago

Hi,

Has anybody find this problem? I went into an error:

File "run_tracker.py", line 164, in run_mdnet
   feat_dim = pos_feats.size(-1)
AttributeError: 'tuple' object has no attribute 'size'

In the code ,the post_feats was defined in line 162:
pos_feats = (model, image, pos_examples), which is a tuple w/o size attribute.

Do you mean pos_feats[-1].size() ? Because pos_feats[-1] is a ndarray.

But in line 63, you called pos_feats.size(0) again. pos_feats(0)'s type is 'model.MDNet' which doesn't have a size attribute.
hyseob commented 5 years ago

Hi, @Gyiming "pos_feats" is an output from forward_samples(model, image, pos_examples), which is a pytorch tensor, not a tuple. By the way, I recently updated the code to support python3.6+ and pytorch1.0+, so I would appreciate if you to retried with the latest version. Thank you.