-
Notifications
You must be signed in to change notification settings - Fork 111
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
ML starter bot error when training on replays #134
Comments
It's possibly just compressed - compression used is facebook's zstd, so you can decompress it yourself using tools they provide. Alternatively, use the tool we have to download replays in bulk - it decompresses itself - https://forums.halite.io/t/build-a-machine-learning-bot/96 |
Or alternatively, someone can add support for compressed replays in the SVM bot :P |
I was able to get it working by changing the following lines in parse.py line 15: data = json.loads(zstd.loads(f.read()).decode('utf-8')) |
Ah ok, so it was already decompressing. |
Almost certainly the problem is because you are using python 3.5, From the python docs:
|
Thanks Janzert, I'll try that |
Changing to 3.6 worked for me, thanks for the help |
Opened #163 to add version check. |
I have just downloaded several .hlt replay files and when I run the train.py file I am receiving this error
Load Replay: training/replay-20180824-153109-0400-1535139069-32-32.hlt
Traceback (most recent call last):
File "train.py", line 6, in
m.train_on_files('training', 'TheDuck314')
File "/Users/donalbyrne/Workspace/Halite/SVM/model.py", line 43, in train_on_files
game_data = parse.parse_replay_folder(replay_folder, player_name, max_files=self.MAX_FILES)
File "/Users/donalbyrne/Workspace/Halite/SVM/parse.py", line 85, in parse_replay_folder
replay_buffer.append(parse_replay_file(os.path.join(folder_name, file_name), player_name))
File "/Users/donalbyrne/Workspace/Halite/SVM/parse.py", line 15, in parse_replay_file
data = json.loads(zstd.loads(f.read()))
File "/Users/donalbyrne/anaconda/envs/DQN_35/lib/python3.5/json/init.py", line 312, in loads
s.class.name))
TypeError: the JSON object must be str, not 'bytes'
Is this because the replay is not in JSON format?
Any help you can give would be appreciated
The text was updated successfully, but these errors were encountered: