Comments (4)
Ah, this was left over from some old experiments. If the folder isn't found it will start a new training session. If you point it to an existing one, it will restarting training from that checkpoint. This could definitely be made clearer in the code 🤔
from pokemonredexperiments.
Ah, this was left over from some old experiments. If the folder isn't found it will start a new training session. If you point it to an existing one, it will restarting training from that checkpoint. This could definitely be made clearer in the code 🤔
from pokemonredexperiments.
I was able to get it to restore the latest session but I'm getting an error. Maybe someone sees what I'm doing wrong. I added the code needed at the bottom.
session_4da05e87_main_good/poke_439746560_steps
loading checkpoint
/Users/seandolbec/miniconda3/lib/python3.11/site-packages/stable_baselines3/common/save_util.py:166: UserWarning: Could not deserialize object lr_schedule. Consider using custom_objects
argument to replace this object.
Exception: code expected at least 16 arguments, got 15
warnings.warn(
/Users/techmore/miniconda3/lib/python3.11/site-packages/stable_baselines3/common/save_util.py:166: UserWarning: Could not deserialize object clip_range. Consider using custom_objects
argument to replace this object.
Exception: code expected at least 16 arguments, got 15
warnings.warn(
/Users/techmore/miniconda3/lib/python3.11/site-packages/stable_baselines3/common/vec_env/patch_gym.py:95: UserWarning: You loaded a model that was trained using OpenAI Gym. We strongly recommend transitioning to Gymnasium by saving that model again.
warnings.warn(
Wrapping the env in a VecTransposeImage.
/Users/techmore/miniconda3/lib/python3.11/site-packages/stable_baselines3/common/base_class.py:752: UserWarning: You are probably loading a model saved with SB3 < 1.7.0, we deactivated exact_match so you can save the model again to avoid issues in the future (see DLR-RM/stable-baselines3#1233 for more info). Original error: Error(s) in loading state_dict for ActorCriticCnnPolicy:
Missing key(s) in state_dict: "pi_features_extractor.cnn.0.weight", "pi_features_extractor.cnn.0.bias", "pi_features_extractor.cnn.2.weight", "pi_features_extractor.cnn.2.bias", "pi_features_extractor.cnn.4.weight", "pi_features_extractor.cnn.4.bias", "pi_features_extractor.linear.0.weight", "pi_features_extractor.linear.0.bias", "vf_features_extractor.cnn.0.weight", "vf_features_extractor.cnn.0.bias", "vf_features_extractor.cnn.2.weight", "vf_features_extractor.cnn.2.bias", "vf_features_extractor.cnn.4.weight", "vf_features_extractor.cnn.4.bias", "vf_features_extractor.linear.0.weight", "vf_features_extractor.linear.0.bias".
Note: the model should still work fine, this only a warning.
warnings.warn(
step: 490 event: 0.00 level: 4.00 heal: 0.08 op_lvl: 0.00 dead: -0.00 badge: 0.00 explore: 1.01 sum: 5.08healed: 0.5135135135135135
step: 531 event: 0.00 level: 2.00 heal: 0.41 op_lvl: 0.00 dead: -0.00 badge: 0.00 explore: 0.59 sum: 3.00healed: 0.7692307692307692
step: 2047 event: 0.00 level: 5.00 heal: 1.64 op_lvl: 0.00 dead: -0.10 badge: 0.00 explore: 2.16 sum: 8.70------------------------------
| time/ | |
| fps | 96 |
| iterations | 1 |
| time_elapsed | 211 |
| total_timesteps | 20480 |
import glob
import re
def find_latest_session_and_poke():
all_folders = os.listdir()
session_folders = [folder for folder in all_folders if re.match(r'session_[0-9a-fA-F]{8}', folder)]
session_folders.sort()
for session_folder in session_folders:
poke_files = glob.glob(f"{session_folder}/poke_*_steps.zip")
poke_files.sort()
if poke_files:
latest_poke_file = poke_files[-1]
# Remove '.zip' from the filename
latest_poke_file = latest_poke_file[:-4]
return session_folder, latest_poke_file
return None, None
if name == 'main':
...
session_folder, latest_poke_file = find_latest_session_and_poke()
print('\n' + latest_poke_file)
if latest_poke_file:
print('\nloading checkpoint')
model = PPO.load(latest_poke_file, env=env)
from pokemonredexperiments.
I just noticed you can read "saves_to_record.txt" and get the last value instead.
from pokemonredexperiments.
Related Issues (20)
- error randomly happens while training HOT 2
- Module pyboy.logger not found HOT 1
- II
- Coord out of bounds HOT 1
- How to change GPU HOT 5
- Saved games interactive mode HOT 1
- Change Reward function to give points to number of unique pokemon HOT 2
- Windows 10 Random Crash After Unknown Amount of Attempts HOT 3
- What is the (human) learning path to know how to build this from scratch? HOT 1
- i got an error when i tried to install requirements.txt HOT 1
- Please help a French - stuck at installation HOT 3
- business contact
- Step three HOT 2
- × Preparing metadata (pyproject.toml) did not run successfully. HOT 1
- Python 3.12 Issue - "Deprecated Module 'distutils' not available anymore." HOT 1
- How do I use my [AMD] GPU HOT 3
- VisuliseProgress.ipynb error HOT 2
- About Visualization HOT 1
- Error running run_pretrained_interactive.py
- how to show pokemon ID, Lvl and Name below Agent Name on the map?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pokemonredexperiments.