pytorch - 无法在 Google Colab 上安装 Pytorch Lightning Flash
问题描述
Pytorch Lighting Flash 对我来说听起来很有希望。我正在尝试在https://lightning-flash.readthedocs.io/上运行最基本的教程,但我无法让它们运行。
例如,我在这里使用安装说明https://lightning-flash.readthedocs.io/en/latest/installation.html在这里运行此对象检测示例https://lightning-flash.readthedocs.io/en/stable /reference/object_detection.html。
我尝试了几种安装方法,但都没有工作。例如:
pip install 'lightning-flash[image]'
这似乎没有任何错误。然后我导入模块
import flash
from flash.core.data.utils import download_data
from flash.image import ObjectDetectionData, ObjectDetector
闪光灯下方有一个 reg 曲线,所以看起来好像有问题。当我运行该块时,我得到了这些错误。
ImportError: /usr/local/lib/python3.7/dist-packages/torchtext/_torchtext.so: undefined symbol: _ZN2at6detail10noopDeleteEPv
解决方案
Pytorch Lighting Flash 社区中的好人帮助调整了安装命令以使其正常工作。我在这里打开了一个带有详细信息的错误https://github.com/PyTorchLightning/lightning-flash/issues/803
按此顺序安装这些软件包有效:
!pip install torch==1.8.1+cu102 -f https://download.pytorch.org/whl/torch_stable.html
!pip install icevision #==0.9.0a1
!pip install effdet
!pip install lightning-flash[image]
!pip install git+https://github.com/PyTorchLightning/lightning-flash.git
!pip install torchtext==0.9.1
!pip uninstall fastai -y
#There is a bug in the latest release of icevision. Manually apply the fix.
!curl https://raw.githubusercontent.com/airctic/icevision/944b47c5694243ba3f3c8c11a6ef56f05fb111eb/icevision/core/record_components.py --output /usr/local/lib/python3.7/dist-packages/icevision/core/record_components.py
#Restart the kernel
推荐阅读
- typescript - 在 Typescript 中重载全局函数时的引用模块
- python - 用补丁剪裁轴
- java - 为什么 Inteliij Idea 在文件路径中将 @ 符号解释为 null
- python - 将 DataFrame 与 Pks 的所有组合合并
- linux - 为什么我对大写的检查总是会导致 true 即使它不应该?
- javascript - 在 Node express 中导出和导入
- r - 将 abline 添加到填充等高线图
- perl - perl Net::SSH2::Cisco 密钥交换算法 sha1
- laravel - 高级 Eloquent/Laravel 问题。无法使用 morphMany 关系创建 MorphPivot 类
- sql - 访问查询不返回正确的值