CCPD
CCPD copied to clipboard
error self.backends[name].load() with pyTorch 1.0.0
I got error in roi pooling for return self.backends[name].load(), while trying to run demo.py. my env:
CUDA 10.0 Python 2.7.15 |Anaconda, Inc.
print(torch.version) 1.0.0
replacing
self._backend = type2backend[type(input)]
with self._backend = type2backend[input.type()]
solved the problem
I suspect I have newer pytorch. See also: https://discuss.pytorch.org/t/keyerror-class-torch-tensor/22560
full error code:
True Traceback (most recent call last): File "demo.py", line 273, in
fps_pred, y_pred = model_conv(x) File "/home/kamil/miniconda2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(*input, **kwargs) File "/home/kamil/miniconda2/lib/python2.7/site-packages/torch/nn/parallel/data_parallel.py", line 141, in forward return self.module(*inputs[0], **kwargs[0]) File "/home/kamil/miniconda2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(*input, **kwargs) File "demo.py", line 229, in forward roi1 = roi_pooling_ims(_x1, boxNew.mm(p1), size=(16, 8)) File "/home/kamil/programy/CCPD/rpnet/roi_pooling.py", line 73, in roi_pooling_ims output.append(adaptive_max_pool(im, size)) File "/home/kamil/programy/CCPD/rpnet/roi_pooling.py", line 35, in adaptive_max_pool return AdaptiveMaxPool2d(size[0], size[1])(input) File "/home/kamil/programy/CCPD/rpnet/roi_pooling.py", line 18, in forward self._backend = type2backend[type(input)] File "/home/kamil/miniconda2/lib/python2.7/site-packages/torch/_thnn/init.py", line 15, in getitem return self.backends[name].load() KeyError: <class 'torch.Tensor'>
i have meet the same problem,are you solved it ?
replacing
self._backend = type2backend[type(input)]
withself._backend = type2backend[input.type()]
solved the problem
thanks so much .
Ty
thanks
thanks
Did it like you did, but there was a new error.
True
Traceback (most recent call last):
File "demo.py", line 275, in
Is this the need to define the subclass SpatialAdaptiveMaxPooling_updateOutput? Could anybody help me?
I also have the same problem with Pytorch 1.1 and Windows. Perhaps downgrading to pytorch 0.4 solves the problem.
How to downgrade to pytorch 0.4?Remove Pytorch 1.1 and install pytorch 0.4 ?
I am not the best person to recommend but: I would create a new virtual environment and install all required packages.
If you are using conda, conda create - n yourenvname python=x.x source activate yourenvname
and then install all packages you need with
conda install yourpackage1
And then install the pytorch version that are used in this repo.
On Wed, 17 Jul 2019, 08:49 Fansgithub2019, [email protected] wrote:
How to downgrade to pytorch 0.4?Remove Pytorch 1.1 and install pytorch 0.4 ?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/detectRecog/CCPD/issues/17?email_source=notifications&email_token=AKOJJ3DBFXSKOVDTDTIE2PTP73FIRA5CNFSM4GL3T3T2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2DLD3Q#issuecomment-512143854, or mute the thread https://github.com/notifications/unsubscribe-auth/AKOJJ3GKVIRSEISWE4G2ATLP73FIRANCNFSM4GL3T3TQ .