Git Product home page Git Product logo

Comments (5)

erikfrey avatar erikfrey commented on May 3, 2024

Hello! Can you show me what your inference function looks like? Or some kind of simplified repro?

from brax.

flobotics avatar flobotics commented on May 3, 2024

hi,
i just tested it with your training demo (https://colab.research.google.com/github/google/brax/blob/main/notebooks/training.ipynb) . Just add a last code-cell and add:

from brax.io import export
export.to_tf_model( "/content/model/", inference_fn, params, state.obs, state.rng)

then you get the error message

from brax.

flobotics avatar flobotics commented on May 3, 2024

tried with new 0.0.4 and original reacher env and training.ipynb, but now it complains about unexpected keyword use_v2 ? Here is the output

WARNING:tensorflow:Mapping types may not work well with tf.nest. Prefer using MutableMapping for <class 'flax.core.frozen_dict.FrozenDict'>

WARNING:tensorflow:Mapping types may not work well with tf.nest. Prefer using MutableMapping for <class 'flax.core.frozen_dict.FrozenDict'>

WARNING:tensorflow:Mapping types may not work well with tf.nest. Prefer using MutableMapping for <class 'flax.core.frozen_dict.FrozenDict'>

WARNING:tensorflow:Mapping types may not work well with tf.nest. Prefer using MutableMapping for <class 'flax.core.frozen_dict.FrozenDict'>

WARNING:tensorflow:Mapping types may not work well with tf.nest. Prefer using MutableMapping for <class 'flax.core.frozen_dict.FrozenDict'>

WARNING:tensorflow:Mapping types may not work well with tf.nest. Prefer using MutableMapping for <class 'flax.core.frozen_dict.FrozenDict'>

WARNING:tensorflow:Mapping types may not work well with tf.nest. Prefer using MutableMapping for <class 'flax.core.frozen_dict.FrozenDict'>

WARNING:tensorflow:Mapping types may not work well with tf.nest. Prefer using MutableMapping for <class 'flax.core.frozen_dict.FrozenDict'>

WARNING:tensorflow:Mapping types may not work well with tf.nest. Prefer using MutableMapping for <class 'flax.core.frozen_dict.FrozenDict'>

WARNING:tensorflow:Mapping types may not work well with tf.nest. Prefer using MutableMapping for <class 'flax.core.frozen_dict.FrozenDict'>

---------------------------------------------------------------------------

TypeError                                 Traceback (most recent call last)

<ipython-input-5-e53e63964dd5> in <module>()
      1 from brax.io import export
----> 2 export.to_tf_model( "/content/model/", inference_fn, params, state.obs, state.rng)

29 frames

/usr/local/lib/python3.7/dist-packages/jax/experimental/jax2tf/jax2tf.py in _dot_general(lhs, rhs, dimension_numbers, precision, preferred_element_type, _in_avals, _out_aval)
   1617         precision_config_proto,
   1618         preferred_element_type=preferred_element_type,
-> 1619         use_v2=True)
   1620     return res
   1621 

TypeError: dot_general() got an unexpected keyword argument 'use_v2'

from brax.

flobotics avatar flobotics commented on May 3, 2024

with version 0.0.5 is use this statement (only state.rng to rng)

from brax.io import export
export.to_tf_model( "/content/model/", inference_fn, params, state.obs, rng)

but i also returns

TypeError: dot_general() got an unexpected keyword argument 'use_v2'

from brax.

erikfrey avatar erikfrey commented on May 3, 2024

OK, this should be fixed now in 7229ee9. Tensorflow does indeed not like FrozenDict, so in this commit we strip them out.

from brax.

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.