Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: __init__() takes 2 to 4 positional arguments but 5 were given #151

Open
kepler62f opened this issue Mar 11, 2020 · 1 comment

Comments

@kepler62f
Copy link

kepler62f commented Mar 11, 2020

System Information

Device: Raspberry Pi 3 Model B Rev 1.2 ARMv7 Procoessor rev 4 (v7l)
Framework (e.g. MXNET): PyTorch
Framework Version: latest
Python Version: 3.8.0
CPU or GPU: CPU
Python SDK Version: latest
Are you using a custom image: no

Describe the problem

I was trying to load my compiled PyTorch model on my Raspberry 3 by following the following:

https://aws.amazon.com/blogs/aws/amazon-sagemaker-neo-train-your-machine-learning-models-once-run-them-anywhere/

I tried to install the DLR using this script running in a pyenv virtualenv with Python 3.4.10:

https://github.com/neo-ai/neo-ai-dlr/tree/master/install/dlr-1.0-py2.py3-armv7l

But failed because the egg is no longer available. There is also no easy_install3. So I installed the DLR from:

https://neo-ai-dlr.readthedocs.io/en/latest/install.html

using:

https://s3-us-west-2.amazonaws.com/neo-ai-dlr-release/v1.0/pi-armv7l-raspbian4.14.71-glibc2_24-libstdcpp3_4/dlr-1.0-py2.py3-none-any.whl

for rasp2b.

When running the test-dlr.py in:

https://github.com/neo-ai/neo-ai-dlr/blob/master/install/dlr-1.0-py2.py3-armv7l/test-dlr.py

I encountered the following error

TypeError: init() takes 2 to 4 positional arguments but 5 were given

at the code: "model = DLRModel(model_path, input_shape, output_shape, device)

It doesn't seem to be able to take the input_shape and output_shape variables as arguments.

@saranyailla
Copy link

saranyailla commented Mar 19, 2020

I have the same issue. Were you able to resolve this?

Edit: It worked without giving input_shape, output_shape as arguments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants