MatteoH2O1999 / alphaPoke

A pokémon showdown battle-bot project based on reinforcement learning techniques.
GNU General Public License v3.0
8 stars 0 forks source link

keyerror 'losses' #2

Closed godpow closed 2 years ago

godpow commented 2 years ago

keyerror 'losses'.txt WARNING:absl:Found untraced functions such as sequential_585_layer_call_fn, sequential_585_layer_call_and_return_conditional_losses, nest_map_layer_call_fn, nest_map_layer_call_and_return_conditional_losses, lambda_layer_call_fn while saving (showing 5 of 2358). These functions will not be directly callable after loading. C:\Users\CyberKira\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\python\saved_model\nested_structure_coder.py:522: UserWarning: Encoding a StructuredValue with type tf_agents.policies.greedy_policy.DeterministicWithLogProb_ACTTypeSpec; loading this StructuredValue will require that this type be imported and registered. warnings.warn("Encoding a StructuredValue with type %s; loading this " Traceback (most recent call last): File "C:\Users\CyberKira\Downloads\alphaPoke-main\train_alpha_poke.py", line 44, in train_double_dqn(iterations, policy_path, b_format, log_folder) File "C:\Users\CyberKira\Downloads\alphaPoke-main\train_alpha_poke.py", line 29, in train_double_dqn agent.save_training_data(logs) File "C:\Users\CyberKira\Downloads\alphaPoke-main\agents\alpha_poke.py", line 1047, in save_training_data for evaluation in self.evaluations["losses"]: KeyError: 'losses'

godpow commented 2 years ago

@MatteoH2O1999

MatteoH2O1999 commented 2 years ago

Hey @godpow, this is happening because the log function doesn't get called at least once. You should run for at least 1000 iterations.

MatteoH2O1999 commented 2 years ago

Also please keep in mind that this is a uni project and that anything but what is found in the release section is not officially supported. If you still wish to use single files, please keep in mind that they are constantly changing and could be broken. As such, I would kindly ask to limit issues to what is in the release section and bug reports. Issues in using files that are not officially supported should be avoided.