GithubHelp home page GithubHelp logo

Comments (4)

thtrieu avatar thtrieu commented on July 17, 2024 3

No Opkernel means there is no implementation for the hardware running this .pb.
To resolve this, look at class reorg of ./net/ops/convolution.py. It has two methods _forward and forward. The current default option is using forward, which has extract_image_patches - a built-in method of tensorflow.

Swap the names of two methods and you will be using my manual implementation, which should have no problem with Opkernel implementation.

from darkflow.

xunkaixin avatar xunkaixin commented on July 17, 2024

i have change the code, but can not generate .pb
/usr/bin/python3 ./flow.py --model /home/qkj/projects/dark_flow/darkflow/cfg/yolo-voc.cfg --load /home/qkj/projects/dark_flow/darkflow/bin/yolo-voc.weights --savepb

Traceback (most recent call last):
File "./flow.py", line 42, in
tfnet = TFNet(FLAGS)
File "/home/qkj/projects/dark_flow/darkflow/net/build.py", line 50, in init
self.build_forward()
File "/home/qkj/projects/dark_flow/darkflow/net/build.py", line 70, in build_forward
state = op_create(*args)
File "/home/qkj/projects/dark_flow/darkflow/net/ops/init.py", line 27, in op_create
return op_typeslayer_type
File "/home/qkj/projects/dark_flow/darkflow/net/ops/baseop.py", line 42, in init
self.forward()
File "/home/qkj/projects/dark_flow/darkflow/net/ops/convolution.py", line 13, in forward
for i in range(h/s):
TypeError: 'float' object cannot be interpreted as an integer

class reorg(BaseOp):
def forward(self):
inp = self.inp.out
shape = inp.get_shape().as_list()
_, h, w, c = shape
s = self.lay.stride
out = list()
for i in range(h/s):
row_i = list()
for j in range(w/s):
si, sj = s * i, s * j
boxij = inp[:, si: si+s, sj: sj+s,:]
flatij = tf.reshape(boxij, [-1,1,1,css])
row_i += [flatij]
out += [tf.concat(2, row_i)]
self.out = tf.concat(1, out)

def _forward(self):
    inp = self.inp.out
    s = self.lay.stride
    self.out = tf.extract_image_patches(
        inp, [1,s,s,1], [1,s,s,1], [1,1,1,1], 'VALID')

from darkflow.

thtrieu avatar thtrieu commented on July 17, 2024

Hey, that's a bug when translating from Python2 to Python3. Thanks for pointing it out, I updated the code.

from darkflow.

truongbb avatar truongbb commented on July 17, 2024

I got same problem and I swapped 2 function's names but the yolo.pb file is still cause error in Android. Please help me fix this!!!

[[Node: ExtractImagePatches = ExtractImagePatches[T=DT_FLOAT, ksizes=[1, 2, 2, 1], padding="VALID", rates=[1, 1, 1, 1], strides=[1, 2, 2, 1]] (47-leaky)]]

Thanks

from darkflow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.