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

RuntimeError: incompatible bytecode version when loading UMAP model from pickle #2

Closed
JaVanGri opened this issue Sep 13, 2024 · 6 comments

Comments

@JaVanGri
Copy link

I encountered a RuntimeError while attempting to load a pre-trained UMAP model from a pickle file and apply a transformation to an array. The error message indicates an incompatible bytecode version. I am using Python 3.8 and the dependencies from the requirements.txt file. I encountered this issue on both Windows and Linux.

Error message:
UMAP_ISSUE

@f-kretschmer
Copy link
Collaborator

f-kretschmer commented Sep 16, 2024

Hi, could you check your numba-version specifically? I know there are problems with versions different to 0.53.1. SciPy, umap-learn and numba have to have the exact versions specified in the requirements.txt. Are you using pip or mamba/conda for the packages?

@JaVanGri
Copy link
Author

JaVanGri commented Sep 16, 2024

Hi, thanks for the suggestion! I checked my package versions, and they match exactly:

  • umap-learn: 0.5.3
  • numba: 0.53.1
  • scipy: 1.7.1

I set up two different Python environments. In one, I installed the requirements using pip, and in the other, I used conda. Both encountered the same issue.

Could it be possible that the file umap_embedding_biostructures.pkl from https://osf.io/5sxfe/ is broken? I’m not sure if the error stem from the file itself rather than the environment.

@f-kretschmer
Copy link
Collaborator

I checked the file on OSF, and it should be the correct one (m5dsum: 661cc8ff2cd918894e15729180554ff8). I also re-checked that it works in my environment. I'll try to make a cloudpickle version of the file, but I'm out of the office right now, so I'm sorry, might take a bit.

@f-kretschmer
Copy link
Collaborator

Here is a link to the cloudpickle version, maybe that works: https://upload.uni-jena.de/data/66ea7c206f1044.70440131/umap_embedding_biostructures_cp.pkl As I understand it, the python version has to be the same (3.9.18 for me), but otherwise dependency versions don't matter for cloudpickle. The cloudpickle version is 3.0.0. By the way, have you checked the MD5 checksum for the pickle file?

@JaVanGri
Copy link
Author

JaVanGri commented Sep 19, 2024

Thanks again for your prompt help! The MD5 cheksum was correct. Using Python 3.9.18 solved the issue. I would suggest adding a note in the README.md to specify the required Python version for future users.

@f-kretschmer
Copy link
Collaborator

Thanks, glad that it finally worked. I will add that to the README.

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