-
Notifications
You must be signed in to change notification settings - Fork 121
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
Update tfprocess.py for TensorFlow 2.4+ #57
base: master
Are you sure you want to change the base?
Conversation
While trying to train my own model, I happen to found an error within tfprocess.py that made train_maia.py not work if you're using a TensorFlow version that is greater than 2.4.0. The reason is that tf.keras.mixed_precision.experimental API had been removed with the introduction of tf.keras.mixed_precision in TensorFlow 2.4+. To fix this, I changed two lines of code. tf.keras.mixed_precision.experimental.set_policy('mixed_float16'), which can be found in Line 123, was changed to tf.keras.mixed_precision.set_global_policy('mixed_float16'). self.optimizer = tf.keras.mixed_precision.experimental.LossScaleOptimizer(self.optimizer, self.loss_scale), which can be found in Line 150, was changed to self.optimizer = tf.keras.mixed_precision.LossScaleOptimizer(self.optimizer).
Does this change maintain compatibility with Tensorflow 2.1.0? This codebase is meant for replicating our work which was done with the environment given in |
The I would suggest creating some conditional statement that would allow Something like this:
There's probably a better way of coding this, but this is the only thing my small brain can come up with. |
Adding that code is saying the 2.4 code is equivalent to 2.1. But, as you said |
I'm in the middle of training a Maia model that's targeting a rating of around 2500. Once I finish, I can send you the model for testing. |
That's not a replication of our paper, this code is for the the KDD 2020 paper. |
Can you clarify what you mean by the code being for the KDD 2020 paper? What would paper are you referring to? |
Aligning Superhuman AI with Human Behavior: Chess as a Model System is the name of the paper |
Ah, right. I got confused when you said it's not a replication of your paper and referred to something else. Currently, the switch to |
Are there any updates on this? |
In order for me to see if this works, in terms of the end product, I'm currently training a Maia 2200 net. From there, testing it against Maia 1900 would allow me to see whether or not the changes to Keras have any positive or negative effects towards Maia 2200. |
@CallOn84 We have a new model that solves some of the training problems (and the old libraries), but not the data efficiency or expanding the Elo range much. So if you can wait a bit we should have more usable code to release. |
Cool, will do. |
While trying to train my own model, I happen to found an error within
tfprocess.py
that madetrain_maia.py
not work if you're using a TensorFlow version that is greater than 2.4.The reason is that
tf.keras.mixed_precision.experimental
API had been removed with the introduction oftf.keras.mixed_precision
in TensorFlow 2.4+.To fix this, I changed two lines of code.
tf.keras.mixed_precision.experimental.set_policy('mixed_float16')
, which can be found in Line 123, was changed totf.keras.mixed_precision.set_global_policy('mixed_float16')
.self.optimizer = tf.keras.mixed_precision.experimental.LossScaleOptimizer(self.optimizer, self.loss_scale)
, which can be found in Line 150, was changed toself.optimizer = tf.keras.mixed_precision.LossScaleOptimizer(self.optimizer)
.