dattalab / keypoint-moseq

https://keypoint-moseq.readthedocs.io
Other
68 stars 28 forks source link

Import error #44

Closed jonathan-columbiau closed 1 year ago

jonathan-columbiau commented 1 year ago

Hi!

I'm having some difficulty installing and importing on Windows 10. I tried both the CPU and GPU versions, and multiple installation types (conda and pip). I'm consistently getting this error "AttributeError: module 'jax' has no attribute 'typing'"

and think there's some incompatibility between the jax and jaxlib libraries. Do you have any recommendations for how to fix this?

I've also tried on the Google Colab, but the same error pops up. Attached a picture below from the Google Colab. image

Thank you for developing/maintaining kpms, it looks like a great tool.

calebweinreb commented 1 year ago

This is because of a recent update with the jaxtyping library (see https://github.com/dattalab/keypoint-moseq/issues/42). The latest keypoint-moseq version (0.1.2) now pins the jaxtyping version so it should work now if you update keypoint-moseq. Another option is to downgrade jaxtyping to 0.2.14.

pip install -U jaxtyping==0.2.14

If you do upgrade keypoint-moseq to 0.1.1, note that the following line for data loading will have to be updated:

OLD LINE coordinates, confidences = kpms.load_deeplabcut_results(dlc_results)

NEW LINE coordinates, confidences, bodyparts = kpms.load_deeplabcut_results(dlc_results)

(and same if you're using SLEAP)