Git Product home page Git Product logo

Comments (2)

galeone avatar galeone commented on July 22, 2024

Hi, I'm pretty sure the problem is in the preprocessing function. The resize functions are implemented differently from numpy/pillow/tensorflow/sklern/pytorch and thus the input values are different.

Read this article: https://zuru.tech/blog/the-dangers-behind-image-resizing

I suggest you move the pre-processing step inside the TensorFlow graph: in this way, your model will pre-process the input using only pure TensorFlow operations and the behavior will be consistent between every execution environment

from tfgo.

modanesh avatar modanesh commented on July 22, 2024

Thank you for your suggestion. I have taken care to ensure that the pre-processing steps in both Python and Golang produce the same output values, albeit with a different order of dimensions. Specifically, in Python, the input has a shape of (1,3,262,192), whereas in Golang, it has a shape of (1,192,262,3).

However, when attempting to reshape the Golang input to match the Python input, an error message is generated, indicating that the number of groups in the convolution layer is unevenly divisible by the output depth. This error message could be related to the way the input is being processed or the way the convolution layer is defined in the model. Here is the error:

panic: output depth must be evenly divisible by number of groups: 10 vs 64
	 [[{{function_node __inference___call___148}}{{node convolution}}]]

Interestingly this shape mismatch also exists with arrays of ones or zeros. But the model's outputs are the same in those cases. So that's why this discrepancy is confusing to me.

from tfgo.

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.