You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey guys I'm working on a project using tensorflow on the Amazon Web Services microservices platform and I've run into a few problems. I installed tensorflow using pip into a virtualenv. Then I took the contents of /env/lib/python2.7/site-packages/ and zipped it along with my source code into a development package for AWS Lambda (env is the name of my virtualenv). This is the process for using python libraries for an AWS Lambda process and I haven't run into any problems with other libraries. I've done this for numpy,scipy,Pillow, and a bunch of other far less supported libraries and they have all worked fine with Lambda.
However when I attempt to use tensorflow it returns this:
Unable to import module 'classify': Traceback (most recent call last): File "/var/task/tensorflow/python/__init__.py", line 52, in from tensorflow.core.framework.graph_pb2 import * File "/var/task/tensorflow/core/framework/graph_pb2.py", line 6, in from google.protobuf import descriptor as _descriptor ImportError: No module named google.protobuf Error importing tensorflow. Unless you are using bazel, you should not try to import tensorflow from its source directory; please exit the tensorflow source tree, and relaunch your python interpreter from there.
classify is the source script AWS Lambda calls when it is invoked and was zipped along with the contents of /env/lib/python2.7/site-packages/ as I described.
These errors have been addressed a couple of other places but none of the solutions I found on those pages have worked for me, probably because none of them were using lambda. Is it possible that tensorflow just will not work with lambda because of the way lambda imports libraries? If so is there anyway import the tensorflow package from just a source folder that I upload as a zip?
zip contents of /env/lib/python2.7/site-packages with .py file classify
upload to aws lambda function
invoke aws lambda function which calls classify and runs into an issue with "import tensorflow as tf"
It's occurred to me that this probably isn't something tensorflow is probably supporting given that most people aren't using tensorflow inside AWS containers but hopefully someone can help or at least give it their best shot even if they don't specifically have experience with AWS.
Thanks!!
The text was updated successfully, but these errors were encountered:
Hey guys I'm working on a project using tensorflow on the Amazon Web Services microservices platform and I've run into a few problems. I installed tensorflow using pip into a virtualenv. Then I took the contents of /env/lib/python2.7/site-packages/ and zipped it along with my source code into a development package for AWS Lambda (env is the name of my virtualenv). This is the process for using python libraries for an AWS Lambda process and I haven't run into any problems with other libraries. I've done this for numpy,scipy,Pillow, and a bunch of other far less supported libraries and they have all worked fine with Lambda.
However when I attempt to use tensorflow it returns this:
Unable to import module 'classify': Traceback (most recent call last): File
"/var/task/tensorflow/python/__init__.py",
line 52, in from tensorflow.core.framework.graph_pb2 import * File "/var/task/tensorflow/core/framework/graph_pb2.py", line 6, in from google.protobuf import descriptor as _descriptor ImportError: No module named google.protobuf Error importing tensorflow. Unless you are using bazel, you should not try to import tensorflow from its source directory; please exit the tensorflow source tree, and relaunch your python interpreter from there.classify is the source script AWS Lambda calls when it is invoked and was zipped along with the contents of /env/lib/python2.7/site-packages/ as I described.
These errors have been addressed a couple of other places but none of the solutions I found on those pages have worked for me, probably because none of them were using lambda. Is it possible that tensorflow just will not work with lambda because of the way lambda imports libraries? If so is there anyway import the tensorflow package from just a source folder that I upload as a zip?
Specific Steps to Reproduce:
It's occurred to me that this probably isn't something tensorflow is probably supporting given that most people aren't using tensorflow inside AWS containers but hopefully someone can help or at least give it their best shot even if they don't specifically have experience with AWS.
Thanks!!
The text was updated successfully, but these errors were encountered: