Skip to content
This repository has been archived by the owner on Sep 24, 2020. It is now read-only.

0.0.23 - compatibility - windows/sweep-python-api does not work #8

Open
raubitsj opened this issue May 21, 2020 · 1 comment
Open

Comments

@raubitsj
Copy link
Member

No description provided.

@raubitsj
Copy link
Member Author

raubitsj commented May 21, 2020

Reproduce:

(base) jeff@WBONE-WIN C:\Users\jeff\work>python                                                                                                                                                 
Python 3.7.4 (default, Aug  9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32                                                                                            
Type "help", "copyright", "credits" or "license" for more information.                                                                                                                          
>>> import wandb                                                                                                                                                                                
>>> sweep_config = {                                                                                                                                                                            
...   "name": "My Sweep",                                                                                                                                                                       
...   "method": "grid",                                                                                                                                                                         
...   "parameters": {                                                                                                                                                                           
...         "parameter1": {                                                                                                                                                                     
...             "values": [1, 2, 3]                                                                                                                                                             
...         }                                                                                                                                                                                   
...     }                                                                                                                                                                                       
... }                                                                                                                                                                                           
>>>                                                                                                                                                                                             
>>> sweep_id = wandb.sweep(sweep_config)                                                                                                                                                        
Create sweep with ID: kqt0lt4t                                                                                                                                                                  
Sweep URL: https://app.wandb.ai/jhr/uncategorized/sweeps/kqt0lt4t                                                                                                                               
>>> import time                                                                                                                                                                                 
>>>                                                                                                                                                                                             
>>> def train():                                                                                                                                                                                
...     run = wandb.init()                                                                                                                                                                      
...     print("config:", dict(run.config))                                                                                                                                                      
...     for epoch in range(35):                                                                                                                                                                 
...         print("running", epoch)                                                                                                                                                             
...         wandb.log({"metric": run.config.param1, "epoch": epoch})                                                                                                                            
...         time.sleep(1)                                                                                                                                                                       
...                                                                                                                                                                                             
>>> wandb.agent(sweep_id, function=train)                                                                                                                                                       
2020-05-21 15:42:49,714 - wandb.wandb_agent - INFO - Running runs: []                                                                                                                           
2020-05-21 15:42:49,902 - wandb.wandb_agent - INFO - Agent received command: run                                                                                                                
2020-05-21 15:42:49,902 - wandb.wandb_agent - INFO - Agent starting run with config:                                                                                                            
        parameter1: 1                                                                                                                                                                           
Traceback (most recent call last):                                                                                                                                                              
  File "<string>", line 1, in <module>                                                                                                                                                          
  File "C:\Users\jeff\Anaconda3\lib\multiprocessing\spawn.py", line 105, in spawn_main                                                                                                          
    exitcode = _main(fd)                                                                                                                                                                        
  File "C:\Users\jeff\Anaconda3\lib\multiprocessing\spawn.py", line 115, in _main                                                                                                               
    self = reduction.pickle.load(from_parent)                                                                                                                                                   
AttributeError: Can't get attribute 'train' on <module '__main__' (built-in)>                                                                                                                   
2020-05-21 15:42:54,995 - wandb.wandb_agent - INFO - Running runs: ['0jq4hb5p']                                                                                                                 
wandb: Ctrl-c pressed. Waiting for runs to end. Press ctrl-c again to terminate them.                                                                                                           
wandb: Terminating and syncing runs. Press ctrl-c to kill.                                                                                                                                      

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

No branches or pull requests

1 participant