ModuleNotFoundError: No module named 'ioc' in TFlearn Image Classification

ModuleNotFoundError: No module named 'ioc' in TFlearn Image Classification

我正在 python、pycharm 中使用 CNN 设计图像分类器。我想在最后绘制一个精度图。以下是我绘制图表的代码:

 hist = {
'Accuracy' : [x.value for x in ea.Scalars('Accuracy')],
'Validation Accuracy' : [x.value for x in     ea.Scalars('Accuracy/Validation')], 
'Loss' : [x.value for x in ea.Scalars('Loss')],
'Validation Loss' : [x.value for x in ea.Scalars     
('Loss/Validation')]
}

fig = plt.figure()
keys = ['Accuracy', 'Loss', 'Validation Accuracy', 'Validation Loss']
for i,thing in enumerate(keys):
    trace = hist[thing]
    plt.subplot(2,2,i+1)
    plt.plot(range(len(trace)), trace)
    plt.title(thing)

fig.set_tight_layout(True)
fig

当我执行这段代码时,出现以下错误:

Traceback (most recent call last):
  File "E:/VISION - CIFAR 10/CNN - CIFAR Ten/Trainig Model.py", line 4,          in <module>
    import ea as ea
  File "C:\Users\Wahab Abid\CNN - CIFAR Ten\lib\site-packages    \ea\__init__.py", line 1, in <module>
    from ea import cqrs
  File "C:\Users\Wahab Abid\CNN - CIFAR Ten\lib\site-packages\ea\cqrs    \__init__.py", line 3, in <module>
    from ea.cqrs.command import Command
   File "C:\Users\Wahab Abid\CNN - CIFAR Ten\lib\site-packages\ea\cqrs\command\__init__.py", line 2, in <module>
    from ea.cqrs.command.provider import CommandHandlerProvider
  File "C:\Users\Wahab Abid\CNN - CIFAR Ten\lib\site-packages\ea\cqrs    \command\provider.py", line 3, in <module>
    import ioc.loader
ModuleNotFoundError: No module named 'ioc'

有人可以帮忙吗?? 我知道问题出在导入上:

import ea as ea

我只是不明白如何解决它以及在哪里寻找。 谢谢

编辑:ncica 下面的答案解决了这个问题,但现在它提供了另一个错误:

Traceback (most recent call last):
  File "E:/VISION - CIFAR 10/CNN - CIFAR Ten/Trainig Model.py", line 157, in <module>
    'Accuracy' : [x.value for x in ea.Scalars('Accuracy')],
AttributeError: module 'ea' has no attribute 'Scalars'

有人可以帮忙吗? 谢谢。

  • 文件 -> 设置 -> 项目解释器: