Giter Site home page Giter Site logo

Comments (10)

krasserm avatar krasserm commented on September 16, 2024 1

I got it running by defining

def LRN2D(x):
    import tensorflow as tf
    return tf.nn.lrn(x, alpha=1e-4, beta=0.75)

in utils.py i.e. did the tf import inside the function. That's a workaround but I hope it's fine for you.

from face-recognition.

krasserm avatar krasserm commented on September 16, 2024 1

That's not an error but only a warning that the model was not compiled. If you only use the (converted) model for prediction you can ignore the warning.

from face-recognition.

krasserm avatar krasserm commented on September 16, 2024 1

Yes

from face-recognition.

Sparker0i avatar Sparker0i commented on September 16, 2024

Thanks, I did manage to avert that error, but I have got a new one up. I don't know if this is something you could help me with.

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/bin/tflite_convert", line 11, in <module>
    sys.exit(main())
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/contrib/lite/python/tflite_convert.py", line 412, in main
    app.run(main=run_main, argv=sys.argv[:1])
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 125, in run
    _sys.exit(main(argv))
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/contrib/lite/python/tflite_convert.py", line 408, in run_main
    _convert_model(tflite_flags)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/contrib/lite/python/tflite_convert.py", line 100, in _convert_model
    converter = _get_toco_converter(flags)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/contrib/lite/python/tflite_convert.py", line 87, in _get_toco_converter
    return converter_fn(**converter_kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/contrib/lite/python/lite.py", line 368, in from_keras_model_file
    keras_model = _keras.models.load_model(model_file)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/keras/engine/saving.py", line 219, in load_model
    f = h5py.File(filepath, mode='r')
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/h5py/_hl/files.py", line 394, in __init__
    swmr=swmr)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/h5py/_hl/files.py", line 170, in make_fid
    fid = h5f.open(name, flags, fapl=fapl)
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "h5py/h5f.pyx", line 85, in h5py.h5f.open
OSError: Unable to open file (file signature not found)

Were you able to convert the .h5 into .tflite?

from face-recognition.

krasserm avatar krasserm commented on September 16, 2024

I tried tflite_convert --output_file test.tflite --keras_model_file test.h5 and it worked i.e. created the output file.

from face-recognition.

Sparker0i avatar Sparker0i commented on September 16, 2024

Okay, I did get a .tflite file in the end, but did you encounter an error like this during the process:

WARNING:tensorflow:No training configuration found in save file: the model was *not* compiled. Compile it manually.

from face-recognition.

Sparker0i avatar Sparker0i commented on September 16, 2024

Oh ok. Did you encounter that?

from face-recognition.

krasserm avatar krasserm commented on September 16, 2024

Any objections to close this ticket?

from face-recognition.

mohdshafahad avatar mohdshafahad commented on September 16, 2024

NameError Traceback (most recent call last)
in
----> 1 detection_graph = tf.Graph()
2 with detection_graph.as_default():
3 od_graph_def = tf.GraphDef()
4 with tf.gfile.GFile(PATH_TO_FROZEN_GRAPH, 'rb') as fid:
5 serialized_graph = fid.read()

NNameError Traceback (most recent call last)
in
----> 1 detection_graph = tf.Graph()
2 with detection_graph.as_default():
3 od_graph_def = tf.GraphDef()
4 with tf.gfile.GFile(PATH_TO_FROZEN_GRAPH, 'rb') as fid:
5 serialized_graph = fid.read()

NameError: name 'tf' is not defined

from face-recognition.

yyhhgg avatar yyhhgg commented on September 16, 2024

(base) C:\Users\Administrator>python
Python 3.7.7 (default, May 6 2020, 11:45:54) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.

import tensorflow as tf
tf.version
Traceback (most recent call last):
File "", line 1, in
AttributeError: module 'tensorflow' has no attribute 'version'

from face-recognition.

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.