Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign uptf.function and tf.nest break for valid Mapping instances #36146
Comments
This comment has been minimized.
This comment has been minimized.
|
Issue replicating in tf-nightly. Thanks. |
This comment has been minimized.
This comment has been minimized.
|
It looks like The correct solution is either to only support At any rate, this limitation should be documented and a best-effort to detect errors could be made by catching anything exception that the constructor raises and adding a hint about this. For future readers, the workaround is to provide a constructor that accepts key-value pairs, similar to dict's. |
This comment has been minimized.
This comment has been minimized.
|
Hey! I would like to work on this. Could you guide me? |
This comment has been minimized.
This comment has been minimized.
|
Sure, here are a few pointers - First, the documentation of all Second, IsMappingHelper that verifies for supported types should check for Third, the error messages need to be improved. the code of _sequence_like that attempts to reconstruct I hope this helps! As a general guidance, I recommend sending multiple small PRs instead of one big change, to make them easier to review. |
This comment has been minimized.
This comment has been minimized.
|
Hey! Thanks for the input.
Regarding this if am not wrong a couple of the function's documentation need to updated for which I should create a separate PR is what you are suggesting and to do the same for the remaining two broken down problems? |
This comment has been minimized.
This comment has been minimized.
|
I'd start with everything in one PR (docstring changes and small code changes), and if you end up changing lots of code, break it down into more pieces. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
I would like to test tensorflow locally from the github repo, how do I set that up for python? |
This comment has been minimized.
This comment has been minimized.
|
@namedtoaster see the guide: https://www.tensorflow.org/install/source; you may want to skip to the Docker section for a ready-made setup. |
This comment has been minimized.
This comment has been minimized.
|
@mdanatg I downloaded tensorflow from the most current repo and built using the instructions you linked to. When I try to run the code from the notebook (or really any simple tensorflow command), I get the following error.
Is there a way to suppress those features from my CPU so I can run tf? Or do I have to rebuild a new binary that disables those features? Edit: I think I found some possible answers. I'll come back when I've exhausted my attempts |
This comment has been minimized.
This comment has been minimized.
|
@namedtoaster You can safely ignore that warning, but otherwise you want a binary that is built with those features enabled. Try to see if you can rebuild it with these bazel options: |
This comment has been minimized.
This comment has been minimized.
|
@mdanatg thanks for the info. I stand corrected on my last post, I am able to do a simple tensorflow command with the original binary installed. When I tried to re-install with the optimizations I got some compiler errors that I'll try to fix at a later time. I did what you said but I get this output:
My bigger confusion right now is that when I try to run the code from the notebook I get an error about using the wrong number of arguments:
I'm looking into the error right now. I may have an incorrect understanding of kwargs |
This comment has been minimized.
This comment has been minimized.
|
I think the error you see is expected - it's the bug described in the OP. |
This comment has been minimized.
This comment has been minimized.
|
For the instruction set warning, try specifying |
This comment has been minimized.
This comment has been minimized.
|
@mdanatg that makes sense. I should've noticed that -- I will check out that link and give it a try. Thanks |
This comment has been minimized.
This comment has been minimized.
|
Hello I thought this issue was solved but it's been open for quite some time. |
tf.functionmakes invalid assumptions about arguments that areMappinginstances. In general, there are no requirements forMappinginstances to have constructors that accept[(key, value)]initializers, as assumed here.This leads to cryptic exceptions when used with perfectly valid
Mappingsubclasses such as this one:See this Colab notebook for an example.