thtrieu / darkflow

Translate darknet to tensorflow. Load trained weights, retrain/fine-tune using tensorflow, export constant graph def to mobile devices
GNU General Public License v3.0
6.13k stars 2.08k forks source link

Only able to run darkflow with terminal, and not within a script #1152

Closed vOdden closed 3 years ago

vOdden commented 4 years ago

I just recently made a ball detection with darkflow, but I'm only able to run it with the terminal. While running the commands in the terminal it works well: python ./flow --model C:/Users/sigur/PycharmProjects/Pot-GPU/darkflow/cfg/tiny-yolo-voc-2c.cfg --load C:/Users/sigur/PycharmProjects/Pot-GPU/darkflow/bin/tiny-yolo-voc.weights --train --annotation C:/Users/sigur/PycharmProjects/Pot/darkflow/annotations --dataset C:/Users/sigur/PycharmProjects/Pot/darkflow/images --gpu 1.0 --epoch 100

but while trying to run this:

options = {"model": "darkflow/cfg/tiny-yolo-voc-2c.cfg",
           "load": "darkflow/bin/tiny-yolo-voc.weights",
           "batch": 8,
           "epoch": 10,
           "gpu": 1.0,
           "train": True,
           "annotation": "darkflow/annotations",
           "dataset": "darkflow/images"}

tfnet = TFNet(options)

I will receive this error: AssertionError: expect 63102556 bytes, found 63471556

the cfg file has 2 classes with 35 filters.

Versions: Python 3.6 Tensorflow-gpu 1.15

vOdden commented 4 years ago

Also receiving this error: ModuleNotFoundError: No module named 'darkflow.net'

I have tried installing darkflow globally with pip install . After installing globally I receive this error: AssertionError: expect 63102556 bytes, found 63471556. ETA: I can run the script with filters = 125, which is from the original tiny-yolo-voc.cfg file, but then It expects 20 classes as well. Which is not what I want in this scenario.