Open hudfdfdf opened 4 years ago
I suppose that the problem is in library versions. I have: Python 3.7.4, PyTorch 1.1.0, Cuda 9.0.176, cudnn 7.5.1, torchvision 0.3.0, cudatoolkit 9.0 It seems that a similar issue was discussed here: https://github.com/visionml/pytracking/issues/61
I met the same issue. Here is how I solve it and go on. For your reference. In features/extractor.py:65, Comment out original return line, and add lines to put values into python List.
def stride(self): tmp = TensorList([f.stride() for f in self.features if self._return_feature(f)]).unroll() tmpList = [] for i in range(len(tmp)): tmpList.append(tmp[i]) return torch.Tensor(tmpList)
This problem is caused by using low version pytracking repo, and you can solve like this:
Firstly, add these two lines in class TensorList(list)
in pytracking/libs/tensorlist.py
:
def list(self):
return list(self)
And then, modify stride method like this in class MultiResolutionExtractor(ExtractorBase)
in pytracking/features/extractor.py
def stride(self):
return torch.Tensor(TensorList([f.stride() for f in self.features if self._return_feature(f)]).unroll().list())
extractor.py
def stride(self):
sss=TensorList([f.stride() for f in self.features if self._return_feature(f)]).unroll()
usus=[]
for i in range(0,len(sss)):
usus.append(sss[i])
return torch.Tensor(usus)
Delete the 'Torch.tensor' can solve the problem
This problem is caused by using low version pytracking repo, and you can solve like this: Firstly, add these two lines in
class TensorList(list)
inpytracking/libs/tensorlist.py
:def list(self): return list(self)
And then, modify stride method like this in
class MultiResolutionExtractor(ExtractorBase)
inpytracking/features/extractor.py
def stride(self): return torch.Tensor(TensorList([f.stride() for f in self.features if self._return_feature(f)]).unroll().list())
Thanks, it works.
File "/opt/research2/d3s/pytracking/tracker/segm/segm.py", line 96, in initialize feat_max_stride = max(self.params.features_filter.stride()) File "/opt/research2/d3s/pytracking/features/extractor.py", line 66, in stride return torch.Tensor(TensorList([f.stride() for f in self.features if self._return_feature(f)]).unroll()) TypeError:
__cuda_array_interface__
must be a dictI encountered the above problem while running your code, can you help to solve it?