Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing on last step of notebook #158

Open
maxshcherbina opened this issue Dec 10, 2024 · 1 comment
Open

Failing on last step of notebook #158

maxshcherbina opened this issue Dec 10, 2024 · 1 comment

Comments

@maxshcherbina
Copy link

maxshcherbina commented Dec 10, 2024

Hello! I am trying to use this package and I have gotten everything working inside of WSL2. I am running a conda environment and I am able to make it to the last step in the notebook upon where the program fails.

I think I first started with this error:

{
	"name": "ModuleNotFoundError",
	"message": "No module named 'bioimageio.core.build_spec'",
	"stack": "---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[32], line 1
----> 1 model.export_TF(name='Noise2Void - 2D RGB Example',
      2                 description='This is the 2D Noise2Void example trained on RGB data in python.', 
      3                 authors=[\"Max\"],
      4                 test_img=X_val[0], axes='YXC',
      5                 patch_shape=patch_shape)

File ~/miniconda3/envs/n2v10/lib/python3.9/site-packages/csbdeep/models/base_model.py:32, in suppress_without_basedir.<locals>._suppress_without_basedir.<locals>.wrapper(*args, **kwargs)
     30     warn is False or warnings.warn(\"Suppressing call of '%s' (due to basedir=None).\" % f.__name__)
     31 else:
---> 32     return f(*args, **kwargs)

File ~/miniconda3/envs/n2v10/lib/python3.9/site-packages/n2v/models/n2v_standard.py:542, in N2V.export_TF(self, name, description, authors, test_img, axes, patch_shape, license, result_path)
    539 files = [str(config_path.absolute()), str(model_path.absolute())]
    540 result_archive_path = result_path / (result_path.stem + Extensions.BIOIMAGE_EXT.value)
--> 542 build_modelzoo(
    543     result_archive_path,
    544     model_path,
    545     result_path,
    546     input_file,
    547     output_file,
    548     preprocessing,
    549     postprocessing,
    550     doc,
    551     name,
    552     authors,
    553     algorithm,
    554     tf.__version__,
    555     cite,
    556     new_axes,
    557     files
    558 )
    560 print(\"\
Model exported in BioImage ModelZoo format:\
%s\" % str(result_archive_path.resolve()))

File ~/miniconda3/envs/n2v10/lib/python3.9/site-packages/n2v/utils/export_utils.py:126, in build_modelzoo(result_path, weights_path, bundle_path, inputs, outputs, preprocessing, postprocessing, doc, name, authors, algorithm, tf_version, cite, axes, files, **kwargs)
    108 def build_modelzoo(
    109     result_path: Union[str, Path],
    110     weights_path: Union[str, Path],
   (...)
    124     **kwargs,
    125 ):
--> 126     from bioimageio.core.build_spec import build_model
    128     tags_dim = \"3d\" if len(axes) == 5 else \"2d\"
    130     build_model(
    131         root=bundle_path,
    132         weight_uri=weights_path,
   (...)
    156         **kwargs,
    157     )

ModuleNotFoundError: No module named 'bioimageio.core.build_spec'"
}

Despite having the package:

pip show bioimageio.core
Name: bioimageio.core
Version: 0.7.0
Summary: Python functionality for the bioimage model zoo
Home-page: https://github.com/bioimage-io/core-bioimage-io-python
Author: Bioimage Team
Author-email:
License: UNKNOWN
Location: /home/max/miniconda3/envs/n2v10/lib/python3.9/site-packages
Requires: bioimageio.spec, h5py, imageio, loguru, numpy, pydantic, pydantic-settings, requests, ruyaml, tqdm, typing-extensions, xarray
Required-by: n2v
conda list bioimageio
# packages in environment at /home/max/miniconda3/envs/n2v10:
#
# Name                    Version                   Build  Channel
bioimageio-core           0.7.0                    pypi_0    pypi
bioimageio-spec           0.5.3.5                  pypi_0    pypi

Can anyone please verify what I am doing wrong from this point?

@jdeschamps
Copy link
Member

Hi there,

n2v is probably not compatible with the latest bioimageio versions. Unfortunately, it is not clear when was the last compatible version. One should check when was the latest commit to the repo and install bioimageio versions from around that time!

Please note that our favourite way of running Noise2Void nowadays is via the CAREamics library, which explains the lack of maintenance on this repo! If you give it a try and run into issues, we will be happy to help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants