google / google/flax

Flax doesn't work on google colab

Open
#2,861 15 comments 2 reactions 1 assignee Claimed by @andsteing View on GitHub
Priority: P0 (urgent)
Dominant language
Jupyter Notebook
Stars
7.3k
Forks
833
Avg merge
5h 11m
Merged PRs (30d)
5

Description

It seems like flax just stopped working on google colab. Simply running
```
import jax
!pip install --quiet flax
import flax
```
yields the error
```
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
ipython 7.9.0 requires jedi>=0.10, which is not installed.
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
[](https://localhost:8080/#) in
1 import jax
2 get_ipython().system('pip install --quiet flax')
----> 3 import flax

4 frames
[/usr/local/lib/python3.8/dist-packages/flax/core/meta.py](https://localhost:8080/#) in Partitioned()
263 return self.replace(names=tuple(names))
264
--> 265 def get_partition_spec(self) -> jax.sharding.PartitionSpec:
266 """Returns the ``Partitionspec`` for this partitioned value."""
267 return jax.sharding.PartitionSpec(*self.names)

AttributeError: module 'jax.sharding' has no attribute 'PartitionSpec'
```
Can be solved by downgrading Flax to 0.6.4.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.