Commit 32b6c77b authored by chenpangpang's avatar chenpangpang
Browse files

feat: 解决了tensorflow的某些版本构建失败的问题;解决了tensorflow某些版本依赖包不对的问题

parent b073e39e
......@@ -86,18 +86,21 @@ RUN if [ -n "$TORCH_VERSION" ];then \
RUN if [ -n "$TENSORFLOW_VERSION" ]; then \
tf_version_minor=$(echo $TENSORFLOW_VERSION | cut -d'.' -f1-2 ); \
[ "$tf_version_minor" == "2.13" ] || [ "$tf_version_minor" == "2.18" ] && tensorflow_text_version=$tf_version_minor.0rc0 || tensorflow_text_version=$tf_version_minor.*; \
pip install --no-cache-dir tensorflow[and-cuda]==$TENSORFLOW_VERSION tensorflow-text==$tensorflow_text_version tensorflow-hub; \
pip install --no-cache-dir tensorflow==$TENSORFLOW_VERSION -i https://pypi.org/simple/ && \
pip install --no-cache-dir tensorflow-text==$tensorflow_text_version tensorflow-hub; fi
# 2.16.1必须手动添加环境变量
if [ $TENSORFLOW_VERSION == "2.16.1" ]; then \
RUN if [ $TENSORFLOW_VERSION == "2.16.1" ]; then \
python_version=$(echo $IMAGE_TAG | awk -F'[-:]' '{for(i=3;i<=NF;i++) if($i ~ /^py[0-9]+\.[0-9]+$/) {gsub(/^py/,"",$i); print $i; exit}}') && \
CUDNN_PATH=/opt/conda/lib/python$python_version/site-packages/nvidia/cudnn && \
echo "export CUDNN_PATH=$CUDNN_PATH" >> /etc/bash.bashrc && \
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CUDNN_PATH/lib:/usr/local/cuda/lib64" >> /etc/bash.bashrc; \
elif [ $TENSORFLOW_VERSION == "2.7.0" ]; then \
pip install --no-cache-dir protobuf==3.20.*; \
elif [ $TENSORFLOW_VERSION == "2.4.0" ]; then \
pip install --no-cache-dir numpy==1.19.2 matplotlib==3.6.*; \
fi; fi
elif [ $TENSORFLOW_VERSION == "2.7.0" ] || [ $TENSORFLOW_VERSION == "2.6.0" ]; then \
pip install --no-cache-dir protobuf==3.20.*; \
elif [ $TENSORFLOW_VERSION == "2.4.0" ] || [ $TENSORFLOW_VERSION == "2.6.0" ]; then \
pip install --no-cache-dir numpy==1.19.2 matplotlib==3.6.*; \
elif [ $TENSORFLOW_VERSION == "2.10.0" ] || [ $TENSORFLOW_VERSION == "2.11.0" ] || [ $TENSORFLOW_VERSION == "2.9.0" ]|| [ $TENSORFLOW_VERSION == "2.9.3" ]; then \
pip install --no-cache-dir "numpy<2"; fi
# ----- paddlepaddle install -----
RUN if [ -n "$PADDLEPADDLE_VERSION" ] && [ -n "$PADDLE_URL" ]; then \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment