BlueBrain / Deep-Atlas

Apache License 2.0
5 stars 1 forks source link

Problem when trying to download gene #52

Closed EmilieDel closed 2 years ago

EmilieDel commented 2 years ago

From @dkeller9,

I get an error when downloading the gene:

python pipeline/download_gene.py 79591671 results/download-gene/ -e
0%|                                                                   | 0/57 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "/gpfs/bbp.cscs.ch/project/proj34/keller/Deep-Atlas/pipeline/download_gene.py", line 205, in <module>
    sys.exit(main(**kwargs))
  File "/gpfs/bbp.cscs.ch/project/proj34/keller/Deep-Atlas/pipeline/download_gene.py", line 182, in main
    dataset_np, expression_np, metadata_dict = postprocess_dataset(
  File "/gpfs/bbp.cscs.ch/project/proj34/keller/Deep-Atlas/pipeline/download_gene.py", line 110, in postprocess_dataset
    for img_id, section_coordinate, img, img_expression, df in tqdm(
  File "/gpfs/bbp.cscs.ch/ssd/apps/bsd/2022-01-10/stage_applications/install_gcc-11.2.0-skylake/py-tqdm-4.62.3-bopgp2/lib/python3.9/site-packages/tqdm/std.py", line 1180, in __iter__
    for obj in iterable:
  File "/gpfs/bbp.cscs.ch/ssd/apps/bsd/2022-01-10/stage_applications/install_gcc-11.2.0-skylake/py-atldld-0.3.2-hss6lh/lib/python3.9/site-packages/atldld/sync.py", line 420, in run
    img = get_image(
  File "/gpfs/bbp.cscs.ch/ssd/apps/bsd/2022-01-10/stage_applications/install_gcc-11.2.0-skylake/py-atldld-0.3.2-hss6lh/lib/python3.9/site-packages/atldld/utils.py", line 136, in get_image
    with Image.open(image_path) as lazy_img:
  File "/gpfs/bbp.cscs.ch/ssd/apps/bsd/2022-01-10/stage_applications/install_gcc-11.2.0-skylake/py-pillow-8.0.0-dtocg6/lib/python3.9/site-packages/PIL/Image.py", line 2943, in open
    raise UnidentifiedImageError(
PIL.UnidentifiedImageError: cannot identify image file '/gpfs/bbp.cscs.ch/home/dakeller/.cache/atldld/79626861-0.jpg'
EmilieDel commented 2 years ago

Hello @dkeller9 , could you maybe tell us what you obtain when doing (1)

pip freeze | grep pil

(2)

ls -alh /gpfs/bbp.cscs.ch/home/dakeller/.cache/atldld/

As first guesses, I would try doing something like

pip install --upgrade pillow

or

rm /gpfs/bbp.cscs.ch/home/dakeller/.cache/atldld/79626861-0.jpg

before launching the command line again.

dkeller9 commented 2 years ago

The issue was resolved by changing the cache directory, export XDG_CACHE_HOME="$new_directory"