Skip to content
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

Connection to TMInterface issue #90

Open
kirannadanam opened this issue Feb 8, 2025 · 3 comments
Open

Connection to TMInterface issue #90

kirannadanam opened this issue Feb 8, 2025 · 3 comments

Comments

@kirannadanam
Copy link

I pulled everything from the git properly, set up everything, and downloaded the modes and all. When I ran the train.py, I got this text:
"Learner could not load weights
Learner could not load stats
Could not load optimizer"
I'm not sure if this is an issue or if it's just initializing things on the first run. I then get this other actual exception error:
"Worker could not load weights, exception: [Errno 2] No such file or directory: 'C:\Users\myuser\Trackmania AI Project\linesight\save\run_name_to_be_changed\weights1.torch'"
After that error, the script tries to connect to TMInterface after opening two instances of the game, but then it just says:
"Connection to TMInterface unsuccessful for ___s"
Inside the Trackmania console, it says:
"Unknown variable: custom_port"
I tried finding this custom_port variable in the scripts and in the config files, but I couldn't find anything like that. I'm not sure what to do to fix this issue. What should I do?

@kirannadanam
Copy link
Author

I was able to remove the custom_port error in the game console, but i still have the issue of the connection to TMInterface unsuccessful.
In the game_instance_manager.py file, i changed the launch_string to be

launch_string = (
'powershell -executionPolicy bypass -command "& {$process = start-process $args[0] -passthru '
'-argumentList 'run TmForever "'
+ user_config.windows_TMLoader_profile_name
+ '" /configstring=\"'
# Removed: 'set custom_port ' + str(self.tmi_port) + ' '
+ '\"'; echo exit $process.id}" "'
+ str(user_config.windows_TMLoader_path)
+ '"'
)

I would like some help with the "connection to TMInterface unsuccessful" issue.

@pb4git
Copy link
Member

pb4git commented Feb 11, 2025

You can find in the documentation an example that shows what are "normal" messages when starting the training script: https://linesight-rl.github.io/linesight/build/html/wall_text.html

As for changing the launch string : your instance will not be able to connect if the port is not defined, the change you made hides an error but isn't a solution.

Agade has pushed 2 days ago a fix for when there are spaces in windows paths, can you pull the updated code and try again?

@kirannadanam
Copy link
Author

@pb4git I pulled the updated code and I am still getting the issue of "Connection to TMInterface unsuccessful." I also got a library update suggestion for torchrl, but i think that's fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants