clearml
clearml copied to clipboard
unable to load image when using / in the project name
when I use the slash / in the project name (to put the project in subprojects e.g. classification/project1) I cannot visualize the images. I realized that the images are save in the directory e.g. classification%2Fproject1, and the url contains the same, but since % is a special character the url should be classification%252Fproject1, that's why it does not work. if there is another way to put the experiments in a subprojects (automatically) and avoid this issue let me know.
Hi @davidenitti ,
I think that we use %2F
in the path since that's the quoted representation of /
, what you suggest would only work if the path will be unquoted twice...
We'll take a look 🙂
thanks
Hi @davidenitti,
I was not able to reproduce this. I was able to access the image just fine. The link where the image is stored at looks like this for me https://files.clear.ml/bugs%252Freproduce/Image%20reporting.....
.
This is the code I used to try reproduce this:
import numpy as np
from clearml import Task
def report_debug_images(logger, iteration=0):
m = np.eye(256, 256, dtype=np.float)
logger.report_image("image/bug", "image float", iteration=iteration, image=m)
def main():
task = Task.init(project_name="bugs/reproduce", task_name="Image reporting")
logger = task.get_logger()
report_debug_images(logger)
logger.flush()
if __name__ == "__main__":
main()
Am I missing something?
Thanks!
@eugen-ajechiloae-clearml thanks, I realized now that the problem is only when I save the data offline and then I import them. can you try to use the same code in this example with offline_mode and then import it? thank you very much!
@davidenitti Was able to reproduce it now. Hopefully we will fix this soon :)
@eugen-ajechiloae-clearml thanks, do you know if the bug is client side or server side?
@davidenitti the issue is on client side. We already have a PR for the fix it that awaits review. If you can't wait for a RC, you could solve the problem for your usecase this way:
- clone this repo
- open
clearml/backend_interface/metrics/interface.py
in a file editor - add this at the top of the file
from ...storage.util import quote_url
- call the function you just imported at line 286. so
r['url'] = '{}/{}'.format(remote_url, r['key'])
becomesr['url'] = quote_url('{}/{}'.format(remote_url, r['key']))
- uninstall the clearml version you are using now
pip uninstall clearml
and install your patched version of clearml:pip install .
ok thanks
@davidenitti After code review, we concluded that you should actually quote that link further down in the code for better results:
image["source"] = "/".join([remote_url, pre + ".{}".format(task_id), post]):
if debug_sample not in uploaded_files and debug_sample.is_file():
uploaded_files.add(debug_sample)
StorageManager.upload_file(local_file=debug_sample.as_posix(), remote_url=image['source'])
image["source"] = quote_url(image["source"]) # <------ here
@davidenitti , We have an RC ready for this issue, install it by running pip install clearml==1.3.2rc1 Let us know if this solves the issue
Hi @davidenitti,
Did you get a chance to test whether this issue is resolved or not?
Closing this as it was already released. Please reopen if required.