SilvioGiancola / SoccerNetv2-DevKit

Development Kit for the SoccerNet Challenge
MIT License
168 stars 39 forks source link

UnboundLocalError: local variable 'jsonGamesFile' referenced before assignment #1

Closed matteot11 closed 3 years ago

matteot11 commented 3 years ago

Hello, thanks for sharing the great dataset and codebase!

I'm facing the following issue when trying to evaluate spotting performances on the "val" split, by running python EvaluateSpotting.py --SoccerNet_path /path/to/SoccerNet/ --predictions_path /path/to/SoccerNet/outputs/ --split "val":

File <path_to>/SoccerNet/utils.py", line 48, in getListGames
    with open(jsonGamesFile, "r") as json_file:
UnboundLocalError: local variable 'jsonGamesFile' referenced before assignment

The "/path/to/SoccerNet/outputs/" is the path to a directory (not zipped) with the structure as specified in https://github.com/SilvioGiancola/SoccerNetv2-DevKit/tree/main/Evaluation under "Output Format", but I only have the "results_spotting.json" prediction file for each game (not the "results_segmentation.json" and "results_ground.json" ones). Each file follows the structure specified under "Task 1: results_spotting.json". Do you know how to solve it? Thanks again.

Matteo

SilvioGiancola commented 3 years ago

Hi @matteot11 , congrats for raising the 1st issue! :P

I believe your issue is with the parameter --split "val" that should be --split valid. You can also drop the " ". The split are named "train", "valid", "test" or "challenge".

Can you try with python EvaluateSpotting.py --SoccerNet_path /path/to/SoccerNet/ --predictions_path /path/to/SoccerNet/outputs/ --split valid and let me know if you still have an issue?

Cheers,

matteot11 commented 3 years ago

Thanks for the answer! I confirm that using --split valid the Evaluation code works as expected.

Thank you again!