google / flax

Flax is a neural network library for JAX that is designed for flexibility.

Home Page:https://flax.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bad magic number error when following huggingface setup TPU totorial

BirgerMoell opened this issue · comments

I followed the huggingface tutorial for setting up a repo for huggingface
https://github.com/huggingface/transformers/tree/master/examples/research_projects/jax-projects#how-to-install-relevant-libraries

pip install "jax[tpu]>=0.2.16" -f https://storage.googleapis.com/jax-releases/libtpu_releases.html
import jax
jax.device_count()

Problem you have encountered:

I get a bad magic number error

What you expected to happen:

Get a device count

Logs, error messages, etc:

python3 jax-setup.py
Traceback (most recent call last):
File "jax-setup.py", line 1, in
import jax
ImportError: bad magic number in 'jax': b'\x03\xf3\r\n'

Steps to reproduce:

Whenever possible, please provide a minimal example. Please consider submitting it as a Colab link.

pip install "jax[tpu]>=0.2.16" -f https://storage.googleapis.com/jax-releases/libtpu_releases.html

import jax
jax.device_count()

Did you maybe first run with python2 and then python3? You'll need to delete your .pyc files.

I deleted the jax.pyc file and now it's working! Thanks for the incredibly quick help!