Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error processing property '_dropout_mask_cache' of <ContextValueCache> #117

Open
gbaulard opened this issue Mar 17, 2022 · 6 comments
Open

Comments

@gbaulard
Copy link

gbaulard commented Mar 17, 2022

Hello,

Getting this error when running code2seq.py on the java large preprocessed dataset.

Traceback (most recent call last):
  File "C:\Users\gbaulard\Anaconda3\lib\site-packages\tensorflow\python\module\module.py", line 407, in _flatten_module
    leaves = nest.flatten_with_tuple_paths(
  File "C:\Users\gbaulard\Anaconda3\lib\site-packages\tensorflow\python\util\nest.py", line 1698, in flatten_with_tuple_paths
    flatten(structure, expand_composites=expand_composites)))
  File "C:\Users\gbaulard\Anaconda3\lib\site-packages\tensorflow\python\util\nest.py", line 451, in flatten
    return _pywrap_utils.Flatten(structure, expand_composites)
TypeError: '<' not supported between instances of 'WhileBodyFuncGraph' and 'FuncGraph'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\gbaulard\Documents\GitHub\code2seq\code2seq.py", line 29, in <module>
    model.train()
  File "C:\Users\gbaulard\Documents\GitHub\code2seq\modelrunner.py", line 129, in train
    gradients = tape.gradient(loss, self.model.trainable_variables)
  File "C:\Users\gbaulard\Anaconda3\lib\site-packages\tensorflow\python\module\module.py", line 171, in trainable_variables
    return tuple(
  File "C:\Users\gbaulard\Anaconda3\lib\site-packages\tensorflow\python\module\module.py", line 449, in _flatten_module
    for subvalue in subvalues:
  File "C:\Users\gbaulard\Anaconda3\lib\site-packages\tensorflow\python\module\module.py", line 449, in _flatten_module
    for subvalue in subvalues:
  File "C:\Users\gbaulard\Anaconda3\lib\site-packages\tensorflow\python\module\module.py", line 449, in _flatten_module
    for subvalue in subvalues:
  File "C:\Users\gbaulard\Anaconda3\lib\site-packages\tensorflow\python\module\module.py", line 410, in _flatten_module
    six.raise_from(
  File "<string>", line 3, in raise_from
ValueError: Error processing property '_dropout_mask_cache' of <ContextValueCache at 0x17309fd0df0>

This is the line that is beng trggered in module.py of tensorflow :

try:
      leaves = nest.flatten_with_tuple_paths(
          prop, expand_composites=expand_composites)
    except Exception as cause:  # pylint: disable=broad-except
      six.raise_from(
          ValueError(
              "Error processing property {!r} of {!r}".format(key, prop)),
          cause)

Any thoughts appreciated.

Regards

@urialon
Copy link
Contributor

urialon commented Mar 17, 2022

Hi @gbaulard ,
Thank you for your interest in our work!

What python version and tensorflow version are you using?

Best,
Uri

@gbaulard
Copy link
Author

Hi,

We tried :

  • python 3.9.7 with tensorflow 2.8.0
  • python 3.8.10 with tensorflow 2.8.0
    with the unofficial version of the project.

With your official version, it was python 3.6.5 and tensorflow 1.12.0

The 3 configs give this same error, running train.sh bash WSL or code2seq.py in conda.

Best

@ethansaurusrex
Copy link

Hi @gbaulard,

Did you ever find a solution to this issue, I have run into the same problem in the official version and the tensor flow 2.1+ fork by Kolkir. Thanks!

@urialon
Copy link
Contributor

urialon commented Feb 15, 2023

Hi all,
I think that the code supports only tensorflow 1.*.

If you are interested in NL<->code, I recommend checking our newer projects which are all publicly available using the Huggingface library:
https://github.com/VHellendoorn/Code-LMs
https://github.com/neulab/code-bert-score
https://github.com/shuyanzhou/docprompting

Best,
Uri

@ethansaurusrex
Copy link

Hi,

Thank you for the quick reply! I will definitely take a look at those papers.

Best

@lapplislazuli
Copy link

For other people coming here from the 2.1 Fork

The following requirements.txt worked for me:

clang
joblib
libclang
lmdb
networkx
numpy==1.19.5
rouge==0.3.2
tensorflow==2.1
tensorflow-gpu==2.1
keras==2.1
tensorflow_addons==0.9.1
scikit_learn
flatbuffers

However if your GPU is recognized depends on the model - newer GPUs do not support the old CUDA Frameworks required for TF 2.1.
3080Ti is not compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants