-
Notifications
You must be signed in to change notification settings - Fork 7
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching and fixing this bug!
micro_dl/utils/aux_utils.py
Outdated
@@ -198,7 +198,7 @@ def get_sms_im_name(time_idx=None, | |||
""" | |||
|
|||
im_name = "img" | |||
if np.isnan(channel_name): | |||
if channel_name is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for catching this bug. The channel_name can actually be a NaN when loading a frames metadata csv file with pandas, so would it work to replace the line with:
if not pd.isnull(channel_name): ?
The reason this bug escaped notice is because there are no tests for get_sms_im_name in aux_utils_tests.py, so bonus points if you add a test. :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I replaced the line with if not pd.isnull(channel_name):
and added a test. Curious about your feedback! :)
Co-authored-by: Jenny Folkesson <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #153 +/- ##
==========================================
+ Coverage 76.39% 76.67% +0.28%
==========================================
Files 53 53
Lines 4554 4554
==========================================
+ Hits 3479 3492 +13
+ Misses 1075 1062 -13
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Co-authored-by: Jenny Folkesson <[email protected]>
) | ||
nose.tools.assert_equal(im_name, 'img_t00_p10.jpg') | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥇
Great job adding tests! My only comment is that I would separate these into two tests, which makes it easier to spot exactly where the code breaks if a test isn't passing. But that's optional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
Co-authored-by: Jenny Folkesson <[email protected]>
Inference bug
Hi, I get an error when running inference with the latest version of the repo (master branch, #da7dcfc). The variable "channel_name" is automatically extracted from the meta_data in "inference->image_inference" and the "channel_name" info is used in the name of the saved images ("utils->aux_utils".)
The channel_name variable (str) is checked by the statement np.isnan(channel_name), which gives an error.
I changed the line to:
Command:
python /home/pwrai/microDL/microDL/micro_dl/cli/inference_script.py --config /gpfs/CompMicro/projects/virtualstaining/2022_microDL_nuc_mem/configfiles/input_mem/config_inference_2022_03_15_mem_heavy_augmentation_test_40x_error.yml --gpu 3
Configfile (you can use this file to try out the inference):
/gpfs/CompMicro/projects/virtualstaining/2022_microDL_nuc_mem/configfiles/input_mem/config_inference_2022_03_15_mem_heavy_augmentation_z12-74_test_40x.yml
MicroDL was executed in docker (image: microdl_sguo, name: microDL_JR) on hulk.
The inference branch was checked out from master #da7dcfc
Error:
Pandas version in docker
The pandas version must be set to 0.24.2, with 1.1.5 there are interferences with the numpy library. I downgraded the version in the requirements_docker.txt file to prevent the error.
Command:
python /home/pwrai/microDL/microDL/micro_dl/cli/inference_script.py --config /gpfs/CompMicro/projects/virtualstaining/2022_microDL_nuc_mem/configfiles/input_mem/config_inference_2022_03_15_mem_heavy_augmentation_test_40x_error.yml --gpu 3
Error: