我写下 setup.py ,如下所示在google-cloud-ml引擎中设置pytorch
from setuptools import find_packages
from setuptools import setup
REQUIRED_PACKAGES = ['torchvision']
DEPENDENCY_LINKS =['http://download.pytorch.org/whl/cpu/torch-0.3.0.post4-cp27-cp27mu-linux_x86_64.whl']
setup(
name='trainer',
version='0.1',
dependency_links=DEPENDENCY_LINKS,
install_requires=REQUIRED_PACKAGES,
packages=find_packages(),
include_package_data=True,
description='My pytorch trainer application package.'
)
错误消息
"Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-_ZQ7aQ/torch/"
我不知道它发生了什么...... 当我搜索那个问题时...答案只是升级setuptools ...但我不知道如何在ml-engine中升级setuptools ......
所以请帮帮我......! 我想在ml引擎中运行pytorch代码
答案 0 :(得分:1)
像DEPENDENCY_LINKS似乎被pip忽略了。 相反,我将whl文件复制到GCS存储桶,并使用了标记' - package gs://my-bucket/torch-0.3.0.post4-cp27-cp27mu-linux_x86_64.whl'在gcloud中安装whl文件,然后执行' pip install torchvision'它起作用了。
您还需要从setup.py
中删除DEPENDENCY_LINKSfrom setuptools import find_packages
from setuptools import setup
REQUIRED_PACKAGES = ['torchvision']
setup(
name='trainer',
version='0.1',
install_requires=REQUIRED_PACKAGES,
packages=find_packages(),
include_package_data=True,
description='My pytorch trainer application package.'
)