ocean-data-factory-sweden / kso

Notebooks to upload/download marine footage, connect to a citizen science project, train machine learning models and publish marine biological observations.
GNU General Public License v3.0
4 stars 12 forks source link

Tutorial 8 - Error in "Run the preparation script" when trying to aggregate frames #326

Closed ShrimpFather7 closed 7 months ago

ShrimpFather7 commented 7 months ago

Before submitting a bug report, please be aware that your issue must be reproducible with all of the following, otherwise it is non-actionable, and we can not help you:

If this is a custom dataset/training question you must include your train*.jpg, test*.jpg and results.png figures, or we can not help you. You can generate these with utils.plot_results().

🐛 Bug

A clear and concise description of what the bug is.

To Reproduce (REQUIRED)

Input:

# Run the preparation script
mlp.prepare_dataset(
    agg_df=pp.aggregated_zoo_classifications,
    out_path=output_folder.selected,
    img_size=(720, 540),
    perc_test=percentage_test.value,
)

Output:

ValueError                                Traceback (most recent call last)
File /usr/src/app/kso/kso_utils/project.py:1214, in MLProjectProcessor.prepare_dataset.<locals>.on_button_clicked(b)
   1212 self.species_of_interest = species_list.value
   1213 # code for prepare dataset for machine learning
-> 1214 self.modules["yolo_utils"].frame_aggregation(
   1215     project=self.project,
   1216     server_connection=self.server_connection,
   1217     db_connection=self.db_connection,
   1218     out_path=out_path,
   1219     perc_test=perc_test,
   1220     class_list=self.species_of_interest,
   1221     img_size=img_size,
   1222     remove_nulls=remove_nulls,
   1223     track_frames=track_frames,
   1224     n_tracked_frames=n_tracked_frames,
   1225     agg_df=agg_df,
   1226 )

File /usr/src/app/kso/kso_utils/yolo_utils.py:489, in frame_aggregation(project, server_connection, db_connection, out_path, perc_test, class_list, img_size, out_format, remove_nulls, track_frames, n_tracked_frames, agg_df)
    486 # Get movie info from server
    487 from kso_utils.movie_utils import retrieve_movie_info_from_server
--> 489 movie_df, _, _ = retrieve_movie_info_from_server(
    490     project=project,
    491     server_connection=server_connection,
    492     db_connection=db_connection,
    493 )[0]
    495 # If at least one movie is linked to the project
    496 logging.info(f"There are {len(movie_df)} movies")

ValueError: too many values to unpack (expected 3)

Expected behavior

A clear and concise description of what you expected to happen.

Environment

If applicable, add screenshots to help explain your problem.

Assignees

@jannesgg

Additional context

Add any other context about the problem here.

jannesgg commented 7 months ago

Fixed in latest dev. Be sure to do a git pull and test this again.

ShrimpFather7 commented 7 months ago

Did a git pull and the issue still persists

My git pull was done with the following commands:

cd kso git status git stash save remove1 git pull

Could there be something I've done incorrectly or is it something else?

jannesgg commented 7 months ago

@ShrimpFather7 From the path in your traceback (/usr/src/app/kso/kso_utils/project.py:1214), it seems you are running directly through the kso folder and not the kso-dev folder? Try running the tutorial from the kso-dev folder instead as that should contain the latest code changes you pulled using git pull whereas the kso folder is based on the Github hosted image (which may contain outdated code).