Comments (2)
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.
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)
- loading model HOT 2
- cc1.exe: sorry, unimplemented: 64-bit mode not compiled in HOT 1
- Error: W tensorflow/core/framework/op_kernel.cc:1745] OP_REQUIRES failed at lookup_table_op.cc:929 : FAILED_PRECONDITION: Table not initialized. HOT 1
- SparseTensor support HOT 2
- Failed to go get tfgo HOT 3
- tensor example support HOT 6
- Potential memory leak on reloading model HOT 8
- libtensorflow.so: .dynsym local symbol at index 3 (>= sh_info of 3) HOT 2
- Matching between output tensor name and prediction HOT 7
- Thread safety HOT 2
- Panic vs Error HOT 2
- Reading jpg image from disk and passing as input to a pretrained model loaded from disk HOT 4
- Error building "Getting Started" example: rebuild TensorFlow with the appropriate compiler flags HOT 5
- Can I use tfgo for tensorflow 2.11.x? HOT 2
- Convert opencv's `mat` to tfgo's `tensor` HOT 7
- Dark Souls level frustration with compilation project with this library HOT 1
- tfgo Object detection
- Choose output layer of model . HOT 1
- Panic when loading a keras LSTM Model HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tfgo.