awslabs / sagemaker-battlesnake-ai

Starter pack to build an AI for Battlesnake with Amazon Sagemaker more content on wiki:
https://github.com/awslabs/sagemaker-battlesnake-ai/wiki
Apache License 2.0
89 stars 53 forks source link

Fixed Writer #18

Closed kshahzada closed 4 years ago

kshahzada commented 4 years ago

Fixes Issues:

17

Description of changes: Fixed bugs related to using the Writer for MXBoard in the example train.py.

Steps to reproduce:

  1. Run: python3 train.py --should_render --writer --run_name test_1 --render_steps 100
  2. Notice ->

    Traceback (most recent call last): File "train.py", line 193, in run(seed, args) File "train.py", line 42, in run writer = SummaryWriter("logs/{}-seed{}".format(run_name, seed), verbose=False) NameError: name 'run_name' is not defined and/or Traceback (most recent call last): File "train.py", line 193, in run(seed, args) File "train.py", line 91, in run args.writer, args.print_progress) File "/Users/Kshahzada/Documents/GitHub/sagemaker-battlesnake-ai/TrainingEnvironment/examples/dqn_run.py", line 85, in trainer writer.addscalar("rewards{}".format(i), score[i], i_episode) AttributeError: 'bool' object has no attribute 'add_scalar'

Expected Output Should start creating logs for Tensorboard to use.

Actual Output Crashes.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.