修复 google colab 中的“ModuleNotFoundError: No module named 'fsns'” for Attention ocr

Posted

技术标签:

【中文标题】修复 google colab 中的“ModuleNotFoundError: No module named \'fsns\'” for Attention ocr【英文标题】:Fix "ModuleNotFoundError: No module named 'fsns'" in google colab for Attention ocr修复 google colab 中的“ModuleNotFoundError: No module named 'fsns'” for Attention ocr 【发布时间】:2019-11-10 12:13:43 【问题描述】:

我正在尝试在 google colab 中运行 aocr 以进行 ocr 检测,但我似乎收到了上述错误。我正在尝试 tensorflow github 文档中的 attention_ocr。

我尝试使用导出更改路径。我已经尝试过使用 python 2 和 3。此外,我确实将 import fsns 更改为 from . import fsns 以及 from datasets import fsns 在 github 问题中告知

Traceback (most recent call last):
  File "train.py", line 30, in <module>
    import common_flags
  File "/content/models/research/attention_ocr/python/common_flags.py", line 22, in <module>
    import datasets
  File "/content/models/research/attention_ocr/python/datasets/__init__.py", line 16, in <module>
    import fsns
ModuleNotFoundError: No module named 'fsns'

如何解决这个问题以便我可以使用这个程序?

【问题讨论】:

【参考方案1】:

您需要将 PYTHONPATH 设置为当前数据集目录。就像在 Windows 上一样。

#from python/datasets

set PYTHONAPTYH=YOUR_PATH\python\datasets

【讨论】:

以上是关于修复 google colab 中的“ModuleNotFoundError: No module named 'fsns'” for Attention ocr的主要内容,如果未能解决你的问题,请参考以下文章

突然的 Tensorflow / Keras Google Colab 依赖问题`AttributeError: module 'tensorflow._api.v1.compat.v2' has n

Google Colab 上的 Keras YoloV3,AttributeError: module 'keras.backend' has no attribute 'control_flow_o

如何修复 Colab 上的“错误:pytorch3d 构建***失败”错误?

gwpy 包给出错误 - AttributeError:模块“matplotlib.pyplot”在 Google Colab 中没有属性“FigureManagerBase”

google colab [google-colaboratory] ​​中的 conda 环境

安装在 Google Colab 中的 Google Drive 中的相对路径