-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Upgrade atari_wrapper to tf2 #452
Conversation
MichaelSolotky
commented
Aug 4, 2020
- There were 2 functions in the class TFSummary, they used tf1 API, I replaced them with corresponding functions from tf2 API (both are referenced here https://www.tensorflow.org/api_docs/python/tf/summary/scalar).
- There was unnecessary import in the add_summary_scalar function. Tensorflow has to be imported by the time this method is called cause importing is in the constructor of the TFSummary class.
- There was no alternative in natrure_dqn to use NumPy summary even if a corresponding argument is set into a corresponding state -- bug fix.
- Different style of putting (or not putting) spaces between an argument name and its value in a function call in one file -- code style fix
Check out this pull request on Review Jupyter notebook visual diffs & provide feedback on notebooks. Powered by ReviewNB |
If everything's fine, #181 can be closed |
LGTM at a glance. Two questions:
|
|
I don't have any code for testing summaries, but those who worked on checking homework assignments this spring probably do, and @justheuristic should be able to handle this. Regarding writing tests: that would be very nice, and if you feel that you can get them working with little effort, then by all means please implement them. However, if that requires some effort, we'd better direct it towards getting other assignments working with TF2. |
Ok, I'll come back to that soon. Maybe it's not that difficult |
Ok, I've tested the updated version. It doesn't work. But it seems like the previous version didn't work as well. It looks like the reason of using TFSummaries is to eventually look at plots in tensorboard, but there's no writing in files anywhere in this class. Also the step variable here https://github.com/yandexdataschool/Practical_RL/blob/master/week06_policy_based/atari_wrappers.py#L287 |
With @justheuristic we decided to remove TFSummaries, it looks like NumpySummaries should be enough. Plots can be built in pyplot instead of tensorboard. |
I was pretty sure that the previous version worked. Are you sure you enabled recording and flushed the writer after IMO having a way to write summaries to tensorboard is good because it simplifies things quite a bit. Notice that there are many things suggested for plotting and monitoring during training in this task and it could be quite messy when only using |
Well, I'm not insisting on removal. It's easy enough to make a working version with tf2 with some additions to the previous version. First of all, in the previous version summaries were only collected and weren't written anywhere (even logdir wasn't mentioned anywhere) and I think that would stop people who wanted to use tensorboard. So I think the writer should be a member of the TFSummaries class. |
@michaelkonobeev what do you think about this version? (I've tested it) |
My reasoning for not including writer into Also, currently |
Mm, yeah, I think it's possible someone would like to log some additional stuff. And do you think it's ok to write some code for logging that stuff outside the |
And this small PR has taken more time than I expected, so can we just have the last round of conversations and changes and do sth with it? |
I think it's totally ok to have additional code for summaries outside the class. The confusion seems to stem from how summaries in tensorboard work more generally. A student could call |
Ok, I think the code is ready now. There should only be problems with a dirty commit history. |
Um, guys. This is some code to simplify Tensorboard logging. Its existence is not even documented in the notebook, and I guess 95% of students won't bother to read the entire |
@dniku I understand that it's tempting to just merge whatever looks even a little bit reasonable and just move on filing new issues later on, but having different notation/confusing suggestions for hyperparameters, etc is not going to help anybody in solving this assignment. We could've found your suggestions, for example about @MichaelSolotky thanks for the PR! |