Skip to content

TypeError: __init__() got an unexpected keyword argument 'file' #16

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

Closed
BFMarks opened this issue Dec 11, 2017 · 5 comments
Closed

TypeError: __init__() got an unexpected keyword argument 'file' #16

BFMarks opened this issue Dec 11, 2017 · 5 comments

Comments

@BFMarks
Copy link

BFMarks commented Dec 11, 2017

Hello!

Excited to try sage-maker but getting the error below after pip install sagemaker in new virtualenv. Python 2.7.10, Sierra 10.12.6. New to this product but would love to get some direction on this.

Traceback (most recent call last): File "python.py", line 29, in <module> import sagemaker File "****/lib/python2.7/site-packages/sagemaker/__init__.py", line 16, in <module> from sagemaker.amazon.kmeans import KMeans, KMeansModel, KMeansPredictor File "***/lib/python2.7/site-packages/sagemaker/amazon/kmeans.py", line 13, in <module> from sagemaker.amazon.amazon_estimator import AmazonAlgorithmEstimatorBase, registry File "***/lib/python2.7/site-packages/sagemaker/amazon/amazon_estimator.py", line 19, in <module> from sagemaker.amazon.common import write_numpy_to_dense_tensor File "****/lib/python2.7/site-packages/sagemaker/amazon/common.py", line 19, in <module> from sagemaker.amazon.record_pb2 import Record File "***/lib/python2.7/site-packages/sagemaker/amazon/record_pb2.py", line 41, in <module> options=_descriptor._ParseOptions(descriptor_pb2.FieldOptions(), _b('\020\001')), file=DESCRIPTOR), TypeError: __init__() got an unexpected keyword argument 'file'

Any direction welcome.

@lukmis
Copy link
Contributor

lukmis commented Dec 11, 2017

Hi and thanks for trying sagemaker!

The error comes from the generated file so I suspect the issue here might be related to version differences. Specifically, the google.protobuf is a dependency of this file and looks like the version you are using has different class definition.

Could you check what version of protobuf you have installed in your virtualenv? For instance please run:
pip freeze | grep proto
to quickly discover that.

When I run it I see 3.5.0 and didn't hit this problem. If you can change this version in your virtualenv and try again this should go away. Please let us know if this was the case.

@BFMarks
Copy link
Author

BFMarks commented Dec 12, 2017

That did work thanks! I have other issues now but excited to get things going.

@arpan8514
Copy link

No, I am facing the issue at my Ubuntu 14.04:
/object_detection/protos/string_int_label_map_pb2.py", line 41, in
options=None, file=DESCRIPTOR),
TypeError: new() got an unexpected keyword argument 'file' while using protoc-3.2.0. I verified my installed protobuf version with the command "pip freeze | grep proto".
Any suggestion ??

@arpan8514
Copy link

Solved the issue by upgrading the TensorFlow version. :)
Now, I'm using protobuf version - 3.5.1

@xiguakaoya
Copy link

solve the same problem by updating the protobuf version.

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

No branches or pull requests

5 participants