[英]Tensorflow insatllation is failing on AWS python3.8 image when building the docker file
Collecting Flask==1.1.2
Downloading Flask-1.1.2-py2.py3-none-any.whl (94 kB)
Collecting tensorflow==2.4.0
Downloading tensorflow-2.4.0-cp38-cp38-manylinux2010_x86_64.whl (394.8 MB)
ERROR: Exception:
Traceback (most recent call last):
File "/var/lang/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 171, in _merge_into_criterion
crit = self.state.criteria[name]
KeyError: 'tensorflow'
During handling of the above exception, another exception occurred:
File "/var/lang/lib/python3.8/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 52, in _close
self.__callback(self.__buf.getvalue())
File "/var/lang/lib/python3.8/site-packages/pip/_vendor/cachecontrol/controller.py", line 309, in cache_response
cache_url, self.serializer.dumps(request, response, body=body)
File "/var/lang/lib/python3.8/site-packages/pip/_vendor/cachecontrol/serialize.py", line 72, in dumps
return b",".join([b"cc=4", msgpack.dumps(data, use_bin_type=True)])
File "/var/lang/lib/python3.8/site-packages/pip/_vendor/msgpack/__init__.py", line 35, in packb
return Packer(**kwargs).pack(o)
File "/var/lang/lib/python3.8/site-packages/pip/_vendor/msgpack/fallback.py", line 960, in pack
self._pack(obj)
File "/var/lang/lib/python3.8/site-packages/pip/_vendor/msgpack/fallback.py", line 943, in _pack
return self._pack_map_pairs(
File "/var/lang/lib/python3.8/site-packages/pip/_vendor/msgpack/fallback.py", line 1045, in _pack_map_pairs
self._pack(v, nest_limit - 1)
File "/var/lang/lib/python3.8/site-packages/pip/_vendor/msgpack/fallback.py", line 943, in _pack
return self._pack_map_pairs(
File "/var/lang/lib/python3.8/site-packages/pip/_vendor/msgpack/fallback.py", line 1045, in _pack_map_pairs
self._pack(v, nest_limit - 1)
File "/var/lang/lib/python3.8/site-packages/pip/_vendor/msgpack/fallback.py", line 889, in _pack
return self._buffer.write(obj)
MemoryError
The command '/bin/sh -c python3.8 -m pip install -r requirements.txt' returned a non-zero code: 2
Following this blog to create the container image for lambda URL: https://aws.amazon.com/blogs/machine-learning/using-container-images-to-run-tensorflow-models-in-aws-lambda/按照此博客为 lambda URL 创建容器映像: https://aws.amazon.com/blogs/machine-learning/using-container-images-to-run-tensorflow-models-in-aws-lambda/
This is a memory error.这是一个 memory 错误。 When creating the environment, use a larger capacity EC2 instance.创建环境时,请使用容量更大的 EC2 实例。 The default instance type is t2.small.默认实例类型为 t2.small。 I used c5.xlarge and TensorFlow was installed properly.我使用了 c5.xlarge 并且正确安装了 TensorFlow。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.