Ssd.pytorch: div_ only supports scalar multiplication

Created on 20 Sep 2017  路  6Comments  路  Source: amdegroot/ssd.pytorch

when I run I got the error like this
File "/home/luhongchao/anaconda2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 224, in __call__
result = self.forward(input, *kwargs)
File "/home/luhongchao/anaconda2/lib/python2.7/site-packages/torch/nn/parallel/data_parallel.py", line 60, in forward
outputs = self.parallel_apply(replicas, inputs, kwargs)
File "/home/luhongchao/anaconda2/lib/python2.7/site-packages/torch/nn/parallel/data_parallel.py", line 70, in parallel_apply
return parallel_apply(replicas, inputs, kwargs, self.device_ids[:len(replicas)])
File "/home/luhongchao/anaconda2/lib/python2.7/site-packages/torch/nn/parallel/parallel_apply.py", line 67, in parallel_apply
raise output
RuntimeError: div_ only supports scalar multiplication
how did this happened , any others got this?

Most helpful comment

In Python2.7
You can modify
x/=norm
to
x=torch.div(x,norm)
"torch.div" support broadcast ops

All 6 comments

I am having the same problem!

@luhc15 It looks like my problem was due to using Python 2.7. Now I am using Python 3.5 and I have no problem running the code! You can give this solution a shot. Moreover, @amdegroot kindly mentioned that only Python 3+ is supported and I was not paying attention.

Sorry guys, I've been meaning to add Python2.7 support, but haven't had the chance. As @astorfi mentioned, only Python 3+ is supported at the moment.

I got it worked as @astorfi said, used a version of python3+, thanks very much

In Python2.7
You can modify
x/=norm
to
x=torch.div(x,norm)
"torch.div" support broadcast ops

thanks ,it worked when use python3, I'll have a try for the python2.7 version, hope not encounter other problems

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kouyichi picture kouyichi  路  5Comments

bassyess picture bassyess  路  5Comments

oarriaga picture oarriaga  路  4Comments

lmingyin picture lmingyin  路  5Comments

LAWSSSS picture LAWSSSS  路  4Comments