Giter Site home page Giter Site logo

Comments (10)

samjabrahams avatar samjabrahams commented on September 13, 2024

Interesting- I think there was a similar problem reported in #30, but it was closed before it was investigated further.

@zxzhijia - did you manage to fix the accuracy issues, or did you just not bother with the model anymore?

from tensorflow-on-raspberry-pi.

Techblogogy avatar Techblogogy commented on September 13, 2024

No, I've been going at it on my spare time, but to no progress :(

from tensorflow-on-raspberry-pi.

AlexanderLitz avatar AlexanderLitz commented on September 13, 2024

I experienced this issue w/ the released RPI wheel, but when I compiled from source, this issue went away, ie, I got identical results.

from tensorflow-on-raspberry-pi.

dominikandreas avatar dominikandreas commented on September 13, 2024

I have a similar issue. When I run a tensorflow model on my Pi model 3, I only get NANs in the output vector while the same model works fine on other (non ARM) platforms.

I installed tensorflow version 0.12 using the wheel for python 2.7. I'll try to compile it from source and see if that alleviates the issue

from tensorflow-on-raspberry-pi.

samjabrahams avatar samjabrahams commented on September 13, 2024

Are you using a pretrained model? If so, I can try to test it out to see if I can replicate your issue.

from tensorflow-on-raspberry-pi.

dominikandreas avatar dominikandreas commented on September 13, 2024

I tried to compile it from source but bazel killed the pi after 3 hours (my pi restarted not sure what happened). This is my exported graph which I'm using: https://1drv.ms/u/s!AjBMlWMdSnfSg7xkXuRAhgMgRNzXRQ

Its pretrained and includes the weights, exported using freeze_graph.py

from tensorflow-on-raspberry-pi.

samjabrahams avatar samjabrahams commented on September 13, 2024

@dominikandreas I was able to replicate the NaN issue on my RPi. Still working through the issue, but I have a few questions in the meantime:

  1. It looks like some of the saved freezed Variable values are being saved as NaN. For example, running this code returns a bunch of NaN values in the very first constant Tensor used in the graph (run from my desktop rig, not Raspberry Pi):
import tensorflow as tf
# Load GraphDef
gd = tf.GraphDef()
with open('gaph.pb', 'rb') as f:
    gd.ParseFromString(f.read())
# Import GraphDef to Graph
graph = tf.Graph()
with graph.as_default():
    tf.import_graph_def(gd, name='')
# Run Constant Op
sess = tf.Session(graph=graph)
const = graph.get_tensor_by_name('network/conv1_7x7/weights/read/_33__cf__33:0')
print(sess.run([const]))

Could you try running that snippet and seeing if you get NaN values?

  1. Interestingly enough, my desktop is till able to get real-valued outputs from the graph despite seeing a bunch of NaNs; not sure what to make of it.

Will try to get another look at it soon.

from tensorflow-on-raspberry-pi.

dominikandreas avatar dominikandreas commented on September 13, 2024

@samjabrahams good idea checking the weights, not sure why I didn't think of that. I think my model must be overfitting using very large weights. I could imagine that, with those large weights, small differences in computation lead to completely different outcomes.

Interesting to note: I used tfdeploy to export my model to python+numpy and also get NANs in the output of the resulting model. I will retrain my model using weight regularization and see if that still results in a notable difference.

from tensorflow-on-raspberry-pi.

CocebanVlad avatar CocebanVlad commented on September 13, 2024

@dominikandreas any news on that?

from tensorflow-on-raspberry-pi.

dominikandreas avatar dominikandreas commented on September 13, 2024

from tensorflow-on-raspberry-pi.

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.