question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

module 'tensorflow' has no attribute 'variable_scope'

See original GitHub issue

Hi I updated tensorflow but get this error for no-limit Texas Holdem:

AttributeError: module 'tensorflow' has no attribute 'variable_scope'

Seems like a migration issue? https://github.com/tensorflow/tensorflow/issues/7285 Thanks for any advice or fixes.

Best, Sy

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

11reactions
dipampatel18commented, Sep 6, 2020

Replace tf.variable_scope with tf.compat.v1.variable_scope

3reactions
daochenzhacommented, Mar 31, 2020

@systats Hi, the main reason is wrong inputs to DQN.

  1. global_step = tf$Variable(0, name='global_step', trainable=F) should be global_step = tf$Variable(0L, name='global_step', trainable=F) to make sure that the step is integer

  2. In state_shape=env$state_shape,, RLCard needs a list of integers. However, the R somehow interprets it as a single value. To solve this issue, I transform int to list in DQN so that the single value will also work.

  3. In mlp_layers=c(512, 512), the R interfaces input a float value. However, RLCard requires 512 to be an integer. To solve this issue, I transform mlp_layers to a list of integers in DQN.

If you reclone and reinstall the code of RLCard in the master branch. The script should be able to run.

Read more comments on GitHub >

github_iconTop Results From Across the Web

module 'tensorflow' has no attribute 'variable_scope' · Issue ...
When I put this line of code in: mlpr = ANNR([input], layers, batchSize = 256, maxIter = 20000, tol = 0.2, reg =...
Read more >
attributeerror - python3 recognizes tensorflow, but doesn't ...
I am getting the following errors: AttributeError: module 'tensorflow' has no attribute ' ...
Read more >
tf.compat.v1.variable_scope | TensorFlow v2.11.0
Variable scope allows you to create new variables and to share already created ones while providing checks to not create or share by...
Read more >
Module 'tensorflow' Has No Attribute 'get_variable'
Attributeerror module 'tensorflow' has no attribute 'variable_scope' · name_or_scope: This parameter defines the string or variable scope.
Read more >
module 'tensorflow' has no attribute 'variable_scope' - Cupoy
share分享. 創建實例時遇到錯誤 AttributeError: module 'tensorflow' has no attribute 'variable_scope'. 我的tensorflow是2.3.0,是否是版本問題?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found