r-tensorflow-api icon indicating copy to clipboard operation
r-tensorflow-api copied to clipboard

Image does not run, seems like a numpy compatability issue

Open joftius opened this issue 2 years ago • 0 comments

Firstly, I appreciated the blog posts and this repo, thanks very much for your work on it.

I'm on mac OS 11.6, just installed docker, cloned the repo, and built the image without any errors

However, when trying to run the image, I get this

> docker run --rm -it -p 80:80 r-tensorflow-api
2022-03-31 10:25:29.700718: I tensorflow/core/platform/cpu_feature_guard.cc:145] This TensorFlow binary is optimized with Intel(R) MKL-DNN to use the following CPU instructions in performance critical operations:  SSE4.1 SSE4.2 AVX AVX2 FMA
To enable them in non-MKL-DNN operations, rebuild TensorFlow with the appropriate compiler flags.
2022-03-31 10:25:29.707184: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 3300000000 Hz
2022-03-31 10:25:29.708159: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x55880394b500 executing computations on platform Host. Devices:
2022-03-31 10:25:29.708216: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): Host, Default Version
2022-03-31 10:25:29.709221: I tensorflow/core/common_runtime/process_util.cc:115] Creating new thread pool with default inter op setting: 2. Tune using inter_op_parallelism_threads for best performance.
Error in py_call_impl(callable, dots$args, dots$keywords) :
  NotImplementedError: Cannot convert a symbolic Tensor (lstm_1/strided_slice:0) to a numpy array.

Detailed traceback:
  File "/opt/conda/lib/python3.7/site-packages/tensorflow_core/python/keras/saving/save.py", line 146, in load_model
    return hdf5_format.load_model_from_hdf5(filepath, custom_objects, compile)
  File "/opt/conda/lib/python3.7/site-packages/tensorflow_core/python/keras/saving/hdf5_format.py", line 168, in load_model_from_hdf5
    custom_objects=custom_objects)
  File "/opt/conda/lib/python3.7/site-packages/tensorflow_core/python/keras/saving/model_config.py", line 55, in model_from_config
    return deserialize(config, custom_objects=custom_objects)
  File "/opt/conda/lib/python3.7/site-packages/tensorflow_core/python/keras/layers/serialization.py", line 102, in deserialize
    printable_module_name='layer')
  File "/opt/conda/lib/python3.7/site-packages/tensorflow_core/python/keras/utils/generic_utils.py", line 191, in deserialize_keras_object
    list(cus
Calls: plumb ... load_model -> do.call -> <Anonymous> -> py_call_impl
Execution halted

I'm thinking it might have something to do with this part of the Dockerfile, since I think it does not specify which version of numpy to install, so perhaps pip is automatically installing a more recent version that has some compatibility issue with tensorflow 2.0.0. This is just my guesswork, though--I'm completely new to using docker

# install tensorflow and h5py using the pip that links to miniconda (the default pip is for python 2.7)
RUN /opt/conda/bin/conda install tensorflow==2.0.0 h5py==2.10.0 && \
    /opt/conda/bin/conda clean -tipsy

joftius avatar Mar 31 '22 10:03 joftius