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

connect4 failed to start due to module 'tensorflow' has no attribute 'layers' #248

Open
meyrow opened this issue Jul 18, 2021 · 3 comments

Comments

@meyrow
Copy link

meyrow commented Jul 18, 2021

Hello,
I tried to run the default main.py with Othello game. I ran the default main successfully 12 hours.
In order to create some statistics maybe the log should also write to an excell file. How to plot statistics?
I would like to learn and maybe add on the connect4 implementation.
I followed the instruction in README.md. There are no syntax issues after modifing the main.py and pit.py
But at runtime there is an error.
failed to start due to module 'tensorflow' has no attribute 'layers'
\alpha-zero-general-master\alpha-zero-general-master\connect4\tensorflow\Connect4NNet.py", line 20, in __init__ BatchNormalization = tf.layers.batch_normalization AttributeError: module 'tensorflow' has no attribute 'layers'

@goshawk22
Copy link
Contributor

Try running pip install tensorflow or pip3 install tensorflow, depending on which version of python your system defaults to.

What OS are you running?

@meyrow
Copy link
Author

meyrow commented Jul 18, 2021

I use PyCharm 2021.1 on windows 10
both commands in your reply run fine and has be installed.
The python interpreter is 3.8.8 and Tensorflow is 2.3.0
A question: in order to run connect4, do i need to downgrade the tensorflow to use version 1 instead of v2 ?

@goshawk22
Copy link
Contributor

goshawk22 commented Jul 18, 2021

What error do you get now after installing tensorflow?

EDIT:
Just checked the API reference and it does look like you need to downgrade to tensorflow 1.15.

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

2 participants