avik-pal / Wandb.jl

Unofficial Julia bindings for logging experiments to wandb.ai
https://avik-pal.github.io/Wandb.jl/stable/
MIT License
80 stars 10 forks source link

Error Initializing WandbLogger on Windows #1

Closed bhatiaabhinav closed 2 years ago

bhatiaabhinav commented 2 years ago

I have Julia 1.6.2 installed on Windows 11. I am using Miniconda for PyCall.

I am getting the following error on invoking WandbLogger constructor.

julia> using Wandb
[ Info: Using Wandb version 0.12.1

julia> lg = WandbLogger(project = "Wandb.jl", name = nothing)
wandb: Currently logged in as: abhinavbhatia (use `wandb login --relogin` to force relogin)
ERROR: unknown option `-c`

At that point, the interpreter freezes. Everything runs fine on Ubuntu though.

bhatiaabhinav commented 2 years ago

Figured that wandb.init() is causing the problem when trying to create the wandb process. On Windows, adding the argument settings=wandb.Settings(start_method="thread") to the wand.init() call solves the problem.

To pass that argument via WandbLogger constructor, one would need to do:

using PyCall
@pyimport wandb
lg = WandbLogger(project = "Wandb.jl", name = nothing,  settings=wandb.Settings(start_method="thread"))
bhatiaabhinav commented 2 years ago

@avik-pal The problem is happening again. You undid the fix?

avik-pal commented 2 years ago

This is happening even with explicitly passing the settings kwarg? (I don't have a Windows machine to test)

avik-pal commented 2 years ago

@bhatiaabhinav can you try https://github.com/avik-pal/Wandb.jl/pull/5?

bhatiaabhinav commented 2 years ago

I didn't check with explicit kwarg. But I thought you had already made it by default to spawn wandb as a new thread instead of a new process. Maybe I misunderstood.

So if you recommend that we should pass the kwarg explicitly (when on Windows), it would be helpful if you document it in the Readme.

bhatiaabhinav commented 2 years ago

try #5 how?

bhatiaabhinav commented 2 years ago

Ah you want me to test that new branch. Ok let me try.

bhatiaabhinav commented 2 years ago

@avik-pal Yeah it works fine. The pull request looks good to go!

avik-pal commented 2 years ago

Awesome registered a patch release https://github.com/JuliaRegistries/General/pull/49852