MathOnco / valis

Virtual Alignment of pathoLogy Image Series
https://valis.readthedocs.io/en/latest/
MIT License
117 stars 28 forks source link

subprocess.CalledProcessError #53

Open halynyu opened 1 year ago

halynyu commented 1 year ago

Hi, thanks for your great open-source method.

I'm going to run the "register_ihg.py" file in the example folder. Both JDK and Maven were installed, and JAVA_HOME environmental variables were well set as shown in docs.

It it the result of turning the python file.

Failed to bootstrap the artifact.

Possible solutions:
* Double check the endpoint for correctness (https://search.maven.org/).
* Add needed repositories to ~/.jgorc [repositories] block (see README).
* Try with an explicit version number (release metadata might be wrong).

Full Maven error output:

Traceback (most recent call last):
  File "/home/lab/halyn/valis/test.py", line 9, in <module>
    registrar = registration.Valis(slide_src_dir, results_dst_dir)
  File "/home/lab/halyn/valis/valis/valtils.py", line 29, in wrapper
    return f(*args, **kwargs)
  File "/home/lab/halyn/valis/valis/registration.py", line 1873, in __init__
    self.get_imgs_in_dir()
  File "/home/lab/halyn/valis/valis/registration.py", line 2046, in get_imgs_in_dir
    if slide_tools.get_img_type(f) is not None:
  File "/home/lab/halyn/valis/valis/slide_tools.py", line 159, in get_img_type
    slide_io.init_jvm()
  File "/home/lab/halyn/valis/valis/slide_io.py", line 219, in init_jvm
    scyjava.start_jvm([f"-Xmx{mem_gb}G"])
  File "/home/lab/halyn/valis/venv_valis/lib/python3.9/site-packages/scyjava/_java.py", line 190, in start_jvm
    _, workspace = jgo.resolve_dependencies(
  File "/home/lab/halyn/valis/venv_valis/lib/python3.9/site-packages/jgo/jgo.py", line 670, in resolve_dependencies
    raise e
  File "/home/lab/halyn/valis/venv_valis/lib/python3.9/site-packages/jgo/jgo.py", line 641, in resolve_dependencies
    mvn_out = run_and_combine_outputs(mvn, *mvn_args)
  File "/home/lab/halyn/valis/venv_valis/lib/python3.9/site-packages/jgo/jgo.py", line 270, in run_and_combine_outputs
    return subprocess.check_output(command_string, stderr=subprocess.STDOUT)
  File "/home/lab/anaconda3/envs/halyn/lib/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/home/lab/anaconda3/envs/halyn/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '('/home/lab/halyn/apache-maven-3.9.2/bin/mvn', '-B', '-f', '/home/lab/.jgo/ome/formats-gpl/RELEASE/8b71d59b266ce2dc904ad8f355b54be66f8be9dfcb713230c34856f3ac19ae51/pom.xml', 'dependency:resolve')' returned non-zero exit status 2.`

I'm not a good coder, so I don't know why I get this error and how to fix it. I'd really appreciate about any assistance you can provide. Thanks!

cdgatenbee commented 1 year ago

Hi @halynyu, Apologies for taking so long to get back to you. It's hard exactly to say what is going on, but it looks like you are using a conda environment. When you installed java and maven, did you also do it via conda? If not, that might be what is causing the error. If installing maven and java with conda doesn't work, an alternative could be to use the Docker container (installation instructions here) , which already has everything installed, so there shouldn't be any installation or dependencies issues. Please try one of those and let me know if it ends up working out for you.

Best, -Chandler

GregorSistera commented 1 month ago

Hi everyone, I am new in the Digital Pathology game but I would like to provide an answer. I spent 2 full days trying to fix this bootstrap error which was a nightmare. So you need to :

halynyu commented 1 month ago

Dear @GregorSistera , Thank you so much for your interest and response even though it's an old question. I don't remember if I solved it at that time or gave up, but I think I can recall all the methods you explained and solve them if there is the same error next time. I really appreciate your kindness, Thank you so much :)

cdgatenbee commented 1 month ago

Hi @GregorSistera, Thank you for sharing your solution to this issue. Also, I wanted to mention that if you're working with RGB images, you can probably get much smaller ome.tiffs if you set compression="jpeg" and Q=90 (i.e. minimal lossy compression) when you save the images. I've recently run into issues where having compression="lzw" (the previous default) added some distortions to the images, so changing the compression method may also fix the red background.

Best, -Chandler

GregorSistera commented 1 week ago

Hi @cdgatenbee , thank you for the solution, I'll try your method and see if it works for me in VALIS. No problem @halynyu , I think it's a Java/Windows execution issue that shouldn't be existing when using Linux. Best regards.