question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot load bots trained with self_play_train.py

See original GitHub issue

Thank you for your efforts in releasing this exciting library. I am trying to train an agent, and then load that agent to view its behaviour rendered in a pygame window. However, the agents that I train are cannot be loaded into a PermissiveModel because they do not have ‘function_tables’ (or signatures for that matter).

I add the following to examples/rllib/self_play_train.py

   # 7. Train once
   trainer.train()

   # Additions
   trainer.get_policy("av").export_model("./some_path")
   from meltingpot.python import bot
   agent = bot.SavedModelPolicy("./some_path")

Running self_play_train.py results in the following error:

Traceback (most recent call last):
  File "<repo_path>/meltingpot/examples/rllib/self_play_train.py", line 117, in <module>
    main()
  File "<repo_path>/meltingpot/examples/rllib/self_play_train.py", line 114, in main
    agent = bot.SavedModelPolicy("./some_path")
  File "<repo_path>/meltingpot/meltingpot/python/bot.py", line 103, in __init__
    self._model = permissive_model.PermissiveModel(model)
  File "<repo_path>/meltingpot/meltingpot/python/utils/bots/permissive_model.py", line 51, in __init__
    self._tables = self.model.function_tables()
AttributeError: 'AutoTrackable' object has no attribute 'function_tables'

Would it please be possible for you to extend this example to include the saving and loading of bots?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Muff2ncommented, Apr 29, 2022

@duenez that PR #30 fixed issue #26, not this one. The confusion has come because I removed my first PR and split it into two. PR #30 was the first part, I will submit the second part that addresses this issue next week.

0reactions
duenezcommented, May 9, 2022

This should be fixed now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Chatterbot chatbot not performing desirably after training
It is able to answer exactly the statements that it got trained for, simple deviations it is not able to understand. How can...
Read more >
Intelligent AI Chatbot in Python - YouTube
Your browser can't play this video. ... Python AI Projects ... Intents (6:48) Load Training Data (13:35) Prepare Training Data (19:40) Build ...
Read more >
Chatbots Using Python and Rasa - GeeksforGeeks
Rasa is a tool to build custom AI chatbots using Python and natural ... It also allows the user to train the model...
Read more >
hsahovic/poke-env: A python interface for training ... - GitHub
poke-env offers an easy-to-use interface for creating rule-based or training Reinforcement Learning bots to battle on pokemon showdown.
Read more >
ChatterBot: Build a Chatbot With Python
You can apply a similar process to train your bot from different ... Attention: While ChatterBot is still a popular open source solution...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found