facebookresearch / HierVL

[CVPR 2023] HierVL Learning Hierarchical Video-Language Embeddings
Other
43 stars 3 forks source link

Error with Neptune Setup in 'train_egoaggregate.py': NeptuneObserver Not Defined" #7

Closed hudaAlamri closed 10 months ago

hudaAlamri commented 11 months ago

Hello, thank you for your excellent work! I have a question regarding the Neptune setup. I've created an account and obtained my credentials. However, when I attempt to run train_egoaggregate, I encounter the following error:

Exception has occurred: NameError
name 'NeptuneObserver' is not defined
File "/hier_VLA/run/train_egoaggregate.py", line 210, in <module>
ex.observers.append(NeptuneObserver(
NameError: name 'NeptuneObserver' is not defined

Thank you for your assistance!

thechargedneutron commented 11 months ago

I don't see this line ex.observers.append(NeptuneObserver( in our codebase. Can you point out the line where the error is happening in this codebase? Line 210 https://github.com/facebookresearch/HierVL/blob/998a8527ed6a3306e031ee73ed81978db6e99861/trainer/trainer_egoaggregate.py#L210 seems to be something different.

hudaAlamri commented 11 months ago

The line is in : run/train_egoaggregate.py here

thechargedneutron commented 11 months ago

Did you try running with "neptune": false in the config? I did not use neptune in my project and have no experience using it.

thechargedneutron commented 11 months ago

Searching it up says you can import it by using from neptune.integrations.sacred import NeptuneObserver. Can you try this?

hudaAlamri commented 11 months ago

That's correct, I did that and updated the code as follows:

 if config['trainer']['neptune']: 
        # delete this error if you have added your own neptune credentials neptune.ai
        #raise ValueError('Neptune credentials not set up yet.')
        from neptune.integrations.sacred import NeptuneObserver
        import neptune
        run = neptune.init_run( api_token=API_TOKEN,
            project=PROJECT_NAME)
        ex.observers.append(NeptuneObserver(run=run))
        ex.run()

executing this code created another error:

Exception has occurred: MissingConfigError run is missing value(s): ['config', 'args'] File "hiervl/run/train_egoaggregate.py", line 226, in ex.run() sacred.utils.MissingConfigError: run is missing value(s): ['config', 'args']

and changing ex.run() to

ex.run(config,args)

results in the following error:

'Namespace' object has no attribute 'keys' File "hiervl/run/train_egoaggregate.py", line 226, in ex.run(config, args) AttributeError: 'Namespace' object has no attribute 'keys'

thechargedneutron commented 11 months ago

Unfortunately, I have not used neptune for my experiments and I do not have the setup to debug it with neptune. The codebase is based on FronzenInTime (https://github.com/m-bain/frozen-in-time) and they discuss about using neptune in theire README. Feel free to see the instructions there and try their code to see if your neptune setup is correct.