Skip to content
This repository has been archived by the owner on Dec 2, 2023. It is now read-only.

The newly released tf-nightly is incompatible with 'gast=0.2.2' #100

Closed
Sijie-L opened this issue Apr 25, 2020 · 6 comments
Closed

The newly released tf-nightly is incompatible with 'gast=0.2.2' #100

Sijie-L opened this issue Apr 25, 2020 · 6 comments

Comments

@Sijie-L
Copy link

Sijie-L commented Apr 25, 2020

In the environment.yml, it require that 'tf-nightly == 1.5.0.dev20171026'. The tf-nightly 1.x is no longer available. And the newest released tf-nightly 2.2.0 is only compatible with 'gast==0.3.3', which gives rise to the problem of #97 . But the solution 'pinning the gast < 0.3.0' disables tf-nightly 2.2.0.

I tried install the gast 0.2.2, and used tensorflow 2.1.0 instead of tf-nightly 2.2.0. But it then occured the problem #95 and then #99 , which causes failure while importing tangent.

Thus I wonder if there is any simpler and executable way to solve this problem.

@mdanatg
Copy link

mdanatg commented Apr 25, 2020

I think the simplest way is to upgrade the code of tangent to use gast 0.3. It's not terribly complicated, because only a few types of nodes change, and it's quite mechanical. This PR shows examples of how to upgrade various elements. In most cases, gast.Str, gast.Num need to change to gast.Constant. A few other nodes including gast.Name need extra arguments that can be set to None.

@Sijie-L
Copy link
Author

Sijie-L commented Apr 26, 2020

Thank you. I replaced gast.Num, gast.Str, gast.Bytes, gast.Ellipsis, gast.NameConstant with gast.Constant. And then replaced the tf.shape with tf.size. But then it poped up the old problem #99 ,with the error message as below.

`import tangent
Traceback (most recent call last):

File "", line 1, in
import tangent

File "/home/tf942902/Documents/Applications/Anaconda/anaconda3/envs/tangent/lib/python3.7/site-packages/tangent/init.py", line 46, in
from tangent.tf_extensions import *

File "/home/tf942902/Documents/Applications/Anaconda/anaconda3/envs/tangent/lib/python3.7/site-packages/tangent/tf_extensions.py", line 55, in
register_shape_function(ops.EagerTensor, shape_as_list)

File "/home/tf942902/Documents/Applications/Anaconda/anaconda3/envs/tangent/lib/python3.7/site-packages/tangent/utils.py", line 229, in register_shape_function
assert t not in shape_functions

AssertionError`

I read the link you mentioned [https://github.com/google/tangent/blob/master/tangent/utils.py] before carefully but I still couldn't figure out why the function gets called repeatly. Could you please make a further suggestion about how to deal with this problem?

@mdanatg
Copy link

mdanatg commented Apr 27, 2020

@TREiop I left a comment on #99, can you see if that helps? I'm not sure that the assert needs to be raised, but it would be good to debug why it's called repeatedly and whether it's called with the same arguments or not.

@dvicini
Copy link

dvicini commented Aug 26, 2020

Hi,

This problem still persists and I wonder if there is a solution to somehow still be able to use tangent? It seems to be a useful library and it would be a shame if it basically became unusable due to some dependency issues, even if the development is not continuing.

Delio

@mdanatg
Copy link

mdanatg commented Aug 26, 2020

@dvicini I think the only viable solution is to upgrade the code of tangent to be compatible with the new TF release. It's not terribly complicated to do, and I'd be happy to provide guidance; we just need a volunteer to do the upgrade (or help @TREiop finish it, if still working on it).

@dvicini
Copy link

dvicini commented Aug 26, 2020

Thanks for the quick reply! That makes sense. I unfortunately don't have time right now to look into that, otherwise I would be glad to help.
Again, I think this library would be very useful to have running again, as there does not seem to be anything comparable. Other source-to-source tools, as you know, are all pretty old or have pretty restrictive licenses :)

@Sijie-L Sijie-L closed this as completed Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants