如何从googlecolab运行luaml模型

如何从googlecolab运行luaml模型,lua,pytorch,google-colaboratory,Lua,Pytorch,Google Colaboratory,我试图在Github上运行这个模型,但是在GoogleColab上,因为我的计算机没有足够的内存/CPU/任何东西 我已经将我的谷歌硬盘安装到我的笔记本上,通过以下方式将repo克隆到我的硬盘上,并将模型下载到我的硬盘文件夹中,为了测试它是否有效,我使用自述文件中运行Brad Pitt示例的最基本示例,使用: th neural_style.lua -style_image examples/inputs/picasso_selfport1907.jpg -content_image examp

我试图在Github上运行这个模型,但是在GoogleColab上,因为我的计算机没有足够的内存/CPU/任何东西

我已经将我的谷歌硬盘安装到我的笔记本上,通过以下方式将repo克隆到我的硬盘上,并将模型下载到我的硬盘文件夹中,为了测试它是否有效,我使用自述文件中运行Brad Pitt示例的最基本示例,使用:

th neural_style.lua -style_image examples/inputs/picasso_selfport1907.jpg -content_image examples/inputs/brad_pitt.jpg
但由于某种原因,它不会起作用

  • 使用
    subprocess.run()
    刚返回
    没有这样的文件或目录
  • 使用
    !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
    
    第一:

    现在,它应该使用到
    th
    的绝对路径工作:

    !/content/torch/install/bin/th neural_style.lua -style_image examples/inputs/picasso_selfport1907.jpg -content_image examples/inputs/brad_pitt.jpg
    
    !/content/torch/install/bin/th neural_style.lua -style_image examples/inputs/picasso_selfport1907.jpg -content_image examples/inputs/brad_pitt.jpg