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

Cannot run darkflow from main-module because or value error with Tensorflow #1131

Closed Mikkochu closed 4 years ago

Mikkochu commented 4 years ago
import cv2  #Open Source Computer Vision is a library which helps in real-time computer vision and used for Image Processing
from darkflow.net.build import TFNet     #Tfnet is a class in build.py python files through which  Translate darknet to tensorflow.
import matplotlib.pyplot as plt          #it is used for data visualization

import built_graph
#%config InlineBackend.figure_format = 'svg'

# define the model options and run

# Training the model
# define the model options and run
#This step involves training your model based on dataset and labels you generated*

options = {
    'metaLoad':r"C:\Users\Mikko\PycharmProjects\Darknet_project\darkflow-master\built_graph\tiny-yolo-voc-52c.meta",
    'pbLoad':r"C:\Users\Mikko\PycharmProjects\Darknet_project\darkflow-master\built_graph\tiny-yolo-voc-52c.pb",
    'threshold': 0.07,
    'cpu': 1.0

     }
tfnet = TFNet(options)

I'm getting the following error. I'm not sure what I should do to fix this. It's a tensorflow problem, but I have TF installed already. Here are my packages

https://imgur.com/a/w61LSAR

ValueError: NodeDef mentions attr 'explicit_paddings' not in Op<name=Conv2D; signature=input:T, filter:T -> output:T; attr=T:type,allowed=[DT_HALF, DT_BFLOAT16, DT_FLOAT, DT_DOUBLE]; attr=strides:list(int); attr=use_cudnn_on_gpu:bool,default=true; attr=padding:string,allowed=["SAME", "VALID"]; attr=data_format:string,default="NHWC",allowed=["NHWC", "NCHW"]; attr=dilations:list(int),default=[1, 1, 1, 1]>; NodeDef: {{node 0-convolutional}}. (Check whether your GraphDef-interpreting binary is up to date with your GraphDef-generating binary.).

Mohamed209 commented 4 years ago

Image is not clear , I can't see if you're installing is contained in virtual environment or not , if not try to isolate project dependencies inside one and try again virtualenv venv source venv/bin/activate and then install requirements