Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TensorFlow version? #20

Open
virtualmartire opened this issue Apr 24, 2024 · 1 comment
Open

TensorFlow version? #20

virtualmartire opened this issue Apr 24, 2024 · 1 comment

Comments

@virtualmartire
Copy link

Hello,

Still problems in building the package 😔 Now the question is: does openmm-tensorflow require a specific version for the Python and the C API of TensorFlow? Which is the TF version that you used for testing?

With version 2.11.0 of TF (python and C), if I do

import tensorflow
import openmmnn

I get

ImportError: /usr/local/lib/libtensorflow.so.2: undefined symbol: scc_info_TensorShapeProto_tensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto

I attach below the Dockerfile for completeness. Thanks!

FROM ubuntu:20.04

ENV DEBIAN_FRONTEND=noninteractive

ENV PYTHON_VERSION=3.8
ENV TF_KIND=cpu
#ENV CUDA_HOME="/usr/local/cuda-11.8"
#ENV LD_LIBRARY_PATH="/usr/local/cuda-11.8/lib64"
ENV SFTW_FOLDER=/software 
ENV ENV_NAME=obiwan-md-env
ENV CONDA_FOLDER=$SFTW_FOLDER/anaconda3
 
RUN apt-get update
RUN yes | apt-get install vim wget libfontconfig1 libxrender1 libxext6 nedit git cmake gcc g++

RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/Miniconda3-latest-Linux-x86_64.sh
RUN mkdir $SFTW_FOLDER
RUN sh /tmp/Miniconda3-latest-Linux-x86_64.sh -b -p $CONDA_FOLDER
 
# makes conda command reachable
ENV PATH=$CONDA_FOLDER/bin:${PATH}
 
# add repos for the additional libs to be installed 
RUN yes | conda config --add channels conda-forge
 
# create the actual execution environment
RUN yes | conda install mamba
RUN yes | mamba create -n $ENV_NAME python=$PYTHON_VERSION
 
# install tensorflow low level API
ENV TF_VERSION=2.11.0
RUN wget -q --no-check-certificate https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-$TF_KIND-linux-x86_64-$TF_VERSION.tar.gz
RUN tar -C /usr/local -xzf libtensorflow-$TF_KIND-linux-x86_64-$TF_VERSION.tar.gz
RUN ldconfig /usr/local/lib

# install open openmm 
RUN mamba install -n $ENV_NAME openmm parmed -c conda-forge
 
# install open openmm-tensorflow plugin
RUN git clone https://github.com/openmm/openmm-tensorflow.git
RUN mkdir /openmm-tensorflow/build
WORKDIR /openmm-tensorflow/build
#ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.8/compat
ENV ENV_FOLDER=$CONDA_FOLDER/envs/$ENV_NAME
RUN mamba install -n $ENV_NAME swig -c conda-forge
RUN sed -i '1s/^/%include "factory.i" \n/' /openmm-tensorflow/python/openmmnn.i
COPY box_1crn_GMX.gro /tmp
COPY box_1crn_GMX.top /tmp
COPY test.py /tmp
RUN cmake .. -DPYTHON_EXECUTABLE=$ENV_FOLDER/bin/python -DSWIG_EXECUTABLE=$ENV_FOLDER/bin/swig -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$ENV_FOLDER -DOPENMM_DIR=$ENV_FOLDER -DTENSORFLOW_DIR=/usr/local
#-DCUDA_TOOLKIT_ROOT_DIR=$CUDA_HOME \
#-DNN_BUILD_CUDA_LIB=ON
RUN make
RUN make install
RUN make PythonInstall

RUN mamba install -n $ENV_NAME tensorflow==$TF_VERSION

ENV DEBIAN_FRONTEND=interactive
WORKDIR /
CMD bash
# the conda environment has to be activated manually
@peastman
Copy link
Member

I don't know what version it was, but the last update to this package was in January 2020, so it would have been something quite old. You'll likely need to make changes to get it working with recent versions. If you're interested in doing that and you figure it out, a PR would be welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants