【发布时间】:2019-12-24 01:36:35
【问题描述】:
我是一名医科学生,我正在使用 google colab 来学习 fastAI。
在这个项目中,https://github.com/QinglingGo/Classification-of-Objects-using-Deep-Learning-Model,
我可以实现模型的输出,但是不知道如何执行prediction.py和evaluat_performance.py文件。
当我运行 evaluat_performance.py 时,会出现以下消息:
python3: can't open file 'prediction.py': [Errno 2] No such file or directory
/usr/local/lib/python3.6/dist-packages/IPython/utils/traitlets.py:5: UserWarning: IPython.utils.traitlets has moved to a top-level traitlets package.
warn ("IPython.utils.traitlets has moved to a top-level traitlets package.")
1. Loading Data ...
ImageDataBunch;
Train: LabelList (942 items)
x: SegmentationItemList
Image (3, 256, 256), Image (3, 256, 256), Image (3, 256, 256), Image (3, 256, 256), Image (3, 256, 256)
y: SegmentationLabelList
ImageSegment (1, 256, 256), ImageSegment (1, 256, 256), ImageSegment (1, 256, 256), ImageSegment (1, 256, 256), ImageSegment (1, 256, 256)
Path: / content / drive / My Drive / Colab Notebooks / bbc_train / images;
Valid: LabelList (0 items)
x: SegmentationItemList
y: SegmentationLabelList
Path: / content / drive / My Drive / Colab Notebooks / bbc_train / images;
Test: None
2. Instantiating Model ...
Traceback (most recent call last):
File "evaluate_preformance.py", line 66, in <module>
combined_accuracy, classification_accuracy, bbox_score, segmentation_accuracy = evaluate ()
File "evaluate_preformance.py", line 29, in evaluate
M = Model (path = model_dir, file = 'export.pkl')
NameError: name 'Model' is not defined.
我不明白.py文件第6行中"from sample_student import Model"的含义?
谁能帮帮我?
提前致谢!
【问题讨论】:
-
所以从哪里加载数据集。如果它位于谷歌驱动器上,请查看此问题stackoverflow.com/questions/48376580/…。之后,您可以从谷歌驱动器加载相同的预测文件,您可以使用 %run 魔术函数在 jupyter notebook 中运行 python 文件。
标签: machine-learning deep-learning pytorch