[ 
https://issues.apache.org/jira/browse/SINGA-457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16846020#comment-16846020
 ] 

Moaz Reyad commented on SINGA-457:
----------------------------------

I also tried the default option (with GPU), but the same error happens:

{code:bash}
$ python backend.py 
Using GPU
Traceback (most recent call last):
  File "backend.py", line 42, in <module>
    backend = sonnx.prepare(model, dev)
  File 
"/home/moaz/singa-gpu/venv/local/lib/python2.7/site-packages/singa/sonnx.py", 
line 254, in prepare
    stores_grad=stores_grad,
  File 
"/home/moaz/singa-gpu/venv/local/lib/python2.7/site-packages/singa/tensor.py", 
line 96, in __init__
    copy_from_numpy(self.data, data)
  File 
"/home/moaz/singa-gpu/venv/local/lib/python2.7/site-packages/singa/tensor.py", 
line 1522, in copy_from_numpy
    'tensor shape should be the same'
AssertionError: tensor shape should be the same
{code}


> Error in ONNX backend.py example
> --------------------------------
>
>                 Key: SINGA-457
>                 URL: https://issues.apache.org/jira/browse/SINGA-457
>             Project: Singa
>          Issue Type: Bug
>            Reporter: Moaz Reyad
>            Priority: Major
>
> I tried to run the file [backend.py | 
> https://github.com/apache/incubator-singa/blob/master/examples/onnx/backend.py]
>  example. I followed the instructions in the file:
> {code:python}
> # load and run the onnx model exported from pytorch
> # 
> https://github.com/onnx/tutorials/blob/master/tutorials/PytorchOnnxExport.ipynb
> {code}
> and executed the file with "use_cpu" option:
> {code:bash}
> python backend.py --use_cpu
> Using CPU
> Traceback (most recent call last):
>   File "backend.py", line 42, in <module>
>     backend = sonnx.prepare(model, dev)
>   File 
> "/home/moaz/singa/venv/local/lib/python2.7/site-packages/singa/sonnx.py", 
> line 254, in prepare
>     stores_grad=stores_grad,
>   File 
> "/home/moaz/singa/venv/local/lib/python2.7/site-packages/singa/tensor.py", 
> line 96, in __init__
>     copy_from_numpy(self.data, data)
>   File 
> "/home/moaz/singa/venv/local/lib/python2.7/site-packages/singa/tensor.py", 
> line 1522, in copy_from_numpy
>     'tensor shape should be the same'
> AssertionError: tensor shape should be the same
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to