NVIDIA-AI-IOT / torch2trt

An easy to use PyTorch to TensorRT converter
MIT License
4.55k stars 671 forks source link

Error occurs when run the example code in README #4

Closed xmfbit closed 5 years ago

xmfbit commented 5 years ago

Hi, when I tried to run the example code in README, error occurs like this:

    model_trt = torch2trt(net, [x])
  File "build/bdist.linux-x86_64/egg/torch2trt/torch2trt.py", line 233, in torch2trt
  File "build/bdist.linux-x86_64/egg/torch2trt/torch2trt.py", line 127, in __init__
  File "build/bdist.linux-x86_64/egg/torch2trt/torch2trt.py", line 106, in __init__
  File "/usr/lib/python2.7/copy.py", line 96, in copy
    return _reconstruct(x, rv, 0)
  File "/usr/lib/python2.7/copy.py", line 329, in _reconstruct
    y = callable(*args)
  File "/usr/lib/python2.7/copy_reg.py", line 93, in __newobj__
    return cls.__new__(cls, *args)
TypeError: instancemethod expected at least 2 arguments, got 0

The environment of mine is: OS: Debian 8 Python: 2.7 TRT: 5.1.5.0, which is the latest version PyTorch: 1.1.0

xmfbit commented 5 years ago

Ok.. I just removed the copy and the problem solved.