tensorflow / tensorflow/probability

Getting error "AttributeError: 'RefVariable' object has no attribute '_id'" running TFP example

Open
#592 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug enhancement
Dominant language
Jupyter Notebook
Stars
4.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

Hi, I am running the DPMM example from the repository on Google Colab.

During running the optimizer step, I am getting the following error:


AttributeError Traceback (most recent call last)
AttributeError: 'RefVariable' object has no attribute '_id'

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

SystemError                               Traceback (most recent call last)
<ipython-input-9-e863f37ccd7f> in <module>()
     17     data_size=num_samples)
     18 
---> 19 train_op = optimizer_kernel.minimize(-joint_log_prob, var_list=training_vals)
     20 
     21 # Arrays to store samples

3 frames
/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/eager/tape.py in watch(tape, tensor)
     57 def watch(tape, tensor):
     58   """Marks this tensor to be watched by the given tape."""
---> 59   pywrap_tensorflow.TFE_Py_TapeWatch(tape._tape, tensor)  # pylint: disable=protected-access
     60 
     61 

SystemError: <built-in function TFE_Py_TapeWatch> returned a result with an error set

I am not able to figure out the cause of this. Kindly suggest a solution.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the repository's DPMM example in Google Colab and reproduce the failure at optimizer_kernel.minimize(-joint_log_prob, var_list=training_vals). Inspect the traceback around the RefVariable '_id' error and the optimizer step. Done means the example completes that step without the reported AttributeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
tensorflow
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.