scenic
scenic copied to clipboard
TypeError: 'type' object is not subscriptable
Hi! I am trying to convert jax checkpoint to tensorflow model (links you provided for tf models do not work), but I get a lot of errors connected with type annotations. For example:
from scenic.common_lib import export_utils
File "/usr/local/lib/python3.8/dist-packages/scenic/common_lib/export_utils.py", line 38, in <module>
Sequence[dict[str, tf.TensorSpec]],
TypeError: 'type' object is not subscriptable
My python version is 3.8, which version should I use to make it work?
Hello, mine is 3.9. have the same issue
@zizimars I updated python version to 3.10 and made it work.
Here is my Dockerfile:
FROM nvidia/cuda:11.8.0-devel-ubuntu22.04
ENV PYTHONUNBUFFERED=1
RUN apt-get update --yes --quiet && DEBIAN_FRONTEND=noninteractive apt-get install --yes --quiet --no-install-recommends \
software-properties-common \
build-essential apt-utils \
wget curl vim git ca-certificates kmod \
nvidia-driver-525 \
&& rm -rf /var/lib/apt/lists/*
RUN add-apt-repository --yes ppa:deadsnakes/ppa && apt-get update --yes --quiet
RUN DEBIAN_FRONTEND=noninteractive apt-get install --yes --quiet --no-install-recommends \
python3.10 \
python3.10-dev \
python3.10-distutils \
python3.10-lib2to3 \
python3.10-gdbm \
python3.10-tk \
pip
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 999 \
&& update-alternatives --config python3 && ln -s /usr/bin/python3 /usr/bin/python
RUN pip install --upgrade pip
RUN pip install cython
RUN git clone https://github.com/google-research/scenic.git
WORKDIR /scenic
RUN python3 -m pip install -vq .
RUN python3 -m pip install -r scenic/projects/owl_vit/requirements.txt
WORKDIR /
RUN mkdir /big_vision
RUN git clone https://github.com/google-research/big_vision.git /big_vision
RUN python3 -m pip install -r /big_vision/big_vision/requirements.txt
RUN python3 -m pip install -U scikit-image
As you can see, I also included cython, because without it I wasn't able to build pycocotools.