在colab上运行darkflow时,它引发AssertionError:预期为63102556字节,发现为63102560。在我的本地计算机上,我通过更改darkflow / utils / loader.py中的偏移值解决了此问题。但是在colab上重复相同的过程并不能解决问题。我该怎么做才能在Colab上运行darkflow以获得结果?
我将loader.py中的偏移值从16更改为20,即16+(63102560-63102556)。尽管这解决了本地计算机中的断言错误,但对colab却无济于事。
代码:
options = {"model": "cfg/yolov2-tiny-voc.cfg",
"load": "yolov2-tiny-voc_10000.weights",
"batch": 8,
"epoch": 100,
"gpu": 1.0,
"train": True,
"annotation": "./annotations/",
"dataset": "./images/"}
tfnet = TFNet(options)
错误消息:
/usr/local/lib/python3.6/dist-packages/darkflow/dark/darknet.py:54: UserWarning: ./cfg/yolov2-tiny-voc_10000.cfg not found, use cfg/yolov2-tiny-voc.cfg instead
cfg_path, FLAGS.model))
Parsing cfg/yolov2-tiny-voc.cfg
Loading yolov2-tiny-voc_10000.weights ...
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
<ipython-input-14-3d45827b7223> in <module>()
8 "dataset": "./images/"}
9
---> 10 tfnet = TFNet(options)
5 frames
/usr/local/lib/python3.6/dist-packages/darkflow/utils/loader.py in load(self, path, src_layers)
75 assert walker.offset == walker.size, \
76 'expect {} bytes, found {}'.format(
---> 77 walker.offset, walker.size)
78 print('Successfully identified {} bytes'.format(
79 walker.offset))
AssertionError: expect 63102556 bytes, found 63102560