【发布时间】:2020-04-16 02:06:04
【问题描述】:
我正在尝试从 Github 但在 Google Colab 上运行此 neural style transfer 模型,因为我的计算机没有足够的内存/CPU/任何东西。
我已将我的谷歌驱动器安装到我的笔记本上,按照this tutorial 将模型下载到我的驱动器文件夹将存储库克隆到我的驱动器上,为了测试它是否有效,我使用的是最基本的运行示例自述文件中的 Brad Pitt 示例使用:
th neural_style.lua -style_image examples/inputs/picasso_selfport1907.jpg -content_image examples/inputs/brad_pitt.jpg
但由于某种原因它不起作用。
- 使用
subprocess.run()刚刚返回No such file or directory - 使用
!th neural_style.lua...返回th: command not found
我尝试了其他四件事,它们都给了我上述两个错误消息的变体。有什么想法吗?
这是完整的笔记本代码,用于从头到尾重现我在 Colab 上的设置/错误:
# Mount the drive
from google.colab import drive
drive.mount('/content/drive')
# Clone the repo onto the drive
!git clone https://github.com/jcjohnson/neural-style
# Install Pytorch
!pip3 install http://download.pytorch.org/whl/cu80/torch-0.3.0.post4-cp36-cp36m-linux_x86_64.whl
!pip3 install torchvision
# Download the models per the github repo instructions
!bash models/download_models.sh
!th neural_style.lua -style_image examples/inputs/picasso_selfport1907.jpg -content_image examples/inputs/brad_pitt.jpg
【问题讨论】:
标签: lua pytorch google-colaboratory