Google Colab 上没有名为 'cupy' 的模块

No module named 'cupy' on Google Colab

我正在处理 FastPhotoStyle 项目: https://github.com/NVIDIA/FastPhotoStyle

然后我按照教程的步骤操作: https://github.com/NVIDIA/FastPhotoStyle/blob/master/TUTORIAL.md

我是 运行 Google Colab 上的示例 1,默认环境是

这是我在 Colab Notebook 上的尝试方式:

https://colab.research.google.com/drive/1oBgdJgXCLlUQhpwPoG1Uom3OKTzHR4BF

运行

之后
!python3 demo.py --output_image_path results/example1.png

这是我收到的错误消息:

Traceback (most recent call last): File "demo.py", line 9, in

import process_stylization

File "/content/drive/FastPhotoStyle/process_stylization.py", line 14, in

from smooth_filter import smooth_filter

File "/content/drive/FastPhotoStyle/smooth_filter.py", line 327, in

from cupy.cuda import function

ModuleNotFoundError: No module named 'cupy'

有人可以帮我吗?

您是否尝试过 运行 具有 python 完整路径的演示?

!/usr/local/lib/python3.6//bin/python3 demo.py --output_image_path 

或运行无需通过简单安装所有必需的库来安装anaconda

!pip install cupy

或查看安装说明here