Git Product home page Git Product logo

Comments (2)

robert-hardwick avatar robert-hardwick commented on June 2, 2024

Have debugged further

input_1
Conv_pad
Conv
Conv/BatchNorm
activation
expanded_conv/depthwise/pad
expanded_conv/depthwise
Traceback (most recent call last):
  File "concatenate_networks.py", line 97, in <module>
    main()
  File "concatenate_networks.py", line 58, in main
    mobilenet_model.save(cmd_args.out_saved_model)
  File "/home/robert/tf2/lib/python3.8/site-packages/tensorflow_core/python/keras/engine/network.py", line 1007, in save
    save.save_model(self, filepath, overwrite, include_optimizer, save_format,
  File "/home/robert/tf2/lib/python3.8/site-packages/tensorflow_core/python/keras/saving/save.py", line 111, in save_model
    hdf5_format.save_model_to_hdf5(
  File "/home/robert/tf2/lib/python3.8/site-packages/tensorflow_core/python/keras/saving/hdf5_format.py", line 109, in save_model_to_hdf5
    save_weights_to_hdf5_group(model_weights_group, model_layers)
  File "/home/robert/tf2/lib/python3.8/site-packages/tensorflow_core/python/keras/saving/hdf5_format.py", line 626, in save_weights_to_hdf5_group
    g = f.create_group(layer.name)
  File "/home/robert/tf2/lib/python3.8/site-packages/h5py/_hl/group.py", line 68, in create_group
    gid = h5g.create(self.id, name, lcpl=lcpl, gcpl=gcpl)
  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/h5g.pyx", line 161, in h5py.h5g.create
ValueError: Unable to create group (name already exists)

Appears that it doesn't like the layer name "depthwise/pad" before the parent group "depthwise"

x = layers.ZeroPadding2D(padding=correct_pad(backend, x, kernel_size),
name=prefix + 'depthwise/pad')(x)

Guess that's something to do the h5 heirarchical data structure.

Renaming depthwise layer here

x = layers.DepthwiseConv2D(kernel_size,
strides=stride,
padding='same' if stride == 1 else 'valid',
use_bias=False,
name=prefix + 'depthwise')(x)
to "depthwise/DepthwiseConv" fixes the error mentioned above, however the predictions are still different compared to saving as SavedModel.

Might be 2 separate issues here.

from keras-applications.

robert-hardwick avatar robert-hardwick commented on June 2, 2024

Again, the above debug was using tensorflow keras, had assumed that keras was silently failing but since fixing the layer naming the problem still persists with same symptoms as kera. Will use keras for further debugging.

from keras-applications.

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.