question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MetricsSaver Bug when filename is long

See original GitHub issue

Describe the bug When using the MetricsSaver handler, a list of filenames will be joined as a string first (see here), and then send to write the metric report.

In distributed mode, the way to join all filenames into a string is directly connect all filenames by the setted delimiter (see here), and all filenames need to be gathered via ignite’s all_gather function first. However, this method has a limitation that if the length of the string to be gathered is larger than 1024, the string will be truncated and only keep the first 1024 characters (the ignite source code of this function is in here).

Therefore, if the filename string is truncated, the number of metrics will be different from the number of filenames.

It is usual to get a larger than 1024 length string, for instance, a filename on my current working dataset is: '/workspace/data/medical/Task04_Hippocampus/imagesTr/hippocampus_033.nii.gz' that has the length 74, thus more than 14 samples will introduce the bug.

Hi @Nic-Ma @wyli , we may need to modify the metric saving way, and avoid gathering the string (tensor or float types do not have the limitation, see here). What do you think?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
vfdev-5commented, Feb 24, 2021

@Nic-Ma thanks for pinging !

Well, the limitation of 1024 is artificial and was done in a way to pad data into a fixed size tensor. In case of MetricsSaver, maybe, it is better to collect names one by one in order to avoid going over 1024 chars.

It is usual to get a larger than 1024 length string, for instance, a filename on my current working dataset is: ‘/workspace/data/medical/Task04_Hippocampus/imagesTr/hippocampus_033.nii.gz’ that has the length 74, thus more than 14 samples will introduce the bug.

@yiheng-wang-nv I do not quite understand your point here. Filepath is 74 chars which is far smaller than 1024, right ? I think also there is a max path lenght on unix systems, like 256 chars … to check that. EDIT: OK, I get it: 74 * 14 = 1036 and this is > 1024.

Anyway, @yiheng-wang-nv thanks for reporting that. I think, we can also think about on how to fix this issue from ignite side as well.

1reaction
Nic-Macommented, Feb 24, 2021

Hi @vfdev-5 ,

Thanks for your help here, hopefully you guys will update it in ignite 0.5. In order to fix it in MONAI first, I submitted a PR: https://github.com/Project-MONAI/MONAI/pull/1634.

Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't run demo, model filename is too long #370 - GitHub
Bug. When I run webcam.py the script tries to download weights for the model, but the filaname for cached files is too long....
Read more >
How to fix path too long and file name too long error - YouTube
How to fix path too long and file name too long error while unzipping compressed file in windows system ( .tar,.zip,.gzip etc )...
Read more >
Hadoop returning less results than expected - Stack Overflow
I have two python scripts a mapper and reducer (basically reducer at this point just prints nothing else) and while locally i get...
Read more >
Errno 36: filename too long -- stops mail delivery
A user sent a Bugzilla page with an auto-generated filename (basically, the query used to generate the page) as an attachment.
Read more >
16.10 - 19 File name too long - Teradata Tools and Utilities
19 File name too long Explanation: During an open operation, the length of the requested ... Remedy: Refer problem to access module support....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found