Skip to content
New issue

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

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

Already on GitHub? # to your account

failing with resnet official model #128

Open
samhodge opened this issue Jul 4, 2019 · 1 comment
Open

failing with resnet official model #128

samhodge opened this issue Jul 4, 2019 · 1 comment

Comments

@samhodge
Copy link

samhodge commented Jul 4, 2019

Installed the bridge according to the instructions

see

(venv-tf-py3) kaos-new:ngraph-test sam$ python -c "import tensorflow as tf; print('TensorFlow version: ',tf.__version__);import ngraph_bridge; print(ngraph_bridge.__version__)"
TensorFlow version:  1.14.0
nGraph bridge version: b'0.16.0-rc1'
nGraph version used for this build: b'0.23.0-rc.3+ba9f0e1'
TensorFlow version used for this build: v1.14.0-rc1-22-gaf24dc91b5
CXX11_ABI flag used for this build: 0
nGraph bridge built with Grappler: False
nGraph bridge built with Variables and Optimizers Enablement: False

downloaded frozen model from reset
http://download.tensorflow.org/models/official/20181001_resnet/savedmodels/resnet_v1_fp32_savedmodel_NHWC.tar.gz

made very simple driver

import tensorflow as tf 
import numpy as np

export_dir = "resnet_v1_fp32_savedmodel_NHWC/1538686669/"

INPUT_TENSOR_NAME = 'input_tensor:0'
OUTPUT_TENSOR_NAME = 'resnet_model/final_dense:0'
import ngraph_bridge

if __name__ == '__main__':
    config = tf.ConfigProto(device_count = {'GPU': 0,'CPU':1})
    config_ngraph_enabled = ngraph_bridge.update_config(config)
    seg_map = None 

    with tf.Session(graph=tf.Graph(),config=config) as sess:
       tf.saved_model.loader.load(sess, ['serve'], export_dir)
       run_metadata = tf.RunMetadata()
       options = tf.RunOptions()
       x = sess.graph.get_tensor_by_name('%s' % INPUT_TENSOR_NAME )
       y = sess.graph.get_tensor_by_name('%s' % OUTPUT_TENSOR_NAME )
       y_out = sess.run(y, feed_dict={
            x:np.ones((64, 224, 224, 3)) 
        },run_metadata=run_metadata,options=options)

Errors as follows:

(venv-tf-py3) kaos-new:ngraph-test sam$ python numberwang.py 
WARNING: Logging before flag parsing goes to stderr.
W0704 07:16:00.670824 140735662560128 deprecation_wrapper.py:119] From numberwang.py:12: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.

W0704 07:16:00.671182 140735662560128 deprecation_wrapper.py:119] From numberwang.py:19: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.

2019-07-04 07:16:00.671626: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
W0704 07:16:00.672065 140735662560128 deprecation.py:323] From numberwang.py:20: load (from tensorflow.python.saved_model.loader_impl) is deprecated and will be removed in a future version.
Instructions for updating:
This function will only be available through the v1 compatibility library as tf.compat.v1.saved_model.loader.load or tf.compat.v1.saved_model.load. There will be a new function for importing SavedModels in Tensorflow 2.0.
W0704 07:16:01.040457 140735662560128 deprecation.py:323] From /Users/sam/dev/ngraph-bridge/build_cmake/venv-tf-py3/lib/python3.6/site-packages/tensorflow/python/training/saver.py:1276: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version.
Instructions for updating:
Use standard file APIs to check for files with this prefix.
2019-07-04 07:16:01.233655: I /Users/sam/dev/ngraph-bridge/src/ngraph_rewrite_pass.cc:247] NGraph using backend: CPU
2019-07-04 07:16:01.399658: I /Users/sam/dev/ngraph-bridge/src/ngraph_rewrite_pass.cc:247] NGraph using backend: CPU
W0704 07:16:01.420220 140735662560128 deprecation_wrapper.py:119] From numberwang.py:21: The name tf.RunMetadata is deprecated. Please use tf.compat.v1.RunMetadata instead.

W0704 07:16:01.420459 140735662560128 deprecation_wrapper.py:119] From numberwang.py:22: The name tf.RunOptions is deprecated. Please use tf.compat.v1.RunOptions instead.

2019-07-04 07:16:01.630263: I /Users/sam/dev/ngraph-bridge/src/ngraph_rewrite_pass.cc:247] NGraph using backend: CPU
2019-07-04 07:16:01.879342: I /Users/sam/dev/ngraph-bridge/src/ngraph_utils.cc:258] Serializing graph to: tf_function_error_ngraph_cluster_2.json

2019-07-04 07:16:01.898499: W tensorflow/core/framework/op_kernel.cc:1502] OP_REQUIRES failed at ngraph_encapsulate_op.cc:507 : Internal: Caught exception while compiling op_backend: ConvolutionBias is only supported with MKLDNN kernel.

Traceback (most recent call last):
  File "/Users/sam/dev/ngraph-bridge/build_cmake/venv-tf-py3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1356, in _do_call
    return fn(*args)
  File "/Users/sam/dev/ngraph-bridge/build_cmake/venv-tf-py3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1341, in _run_fn
    options, feed_dict, fetch_list, target_list, run_metadata)
  File "/Users/sam/dev/ngraph-bridge/build_cmake/venv-tf-py3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1429, in _call_tf_sessionrun
    run_metadata)
tensorflow.python.framework.errors_impl.InternalError: Caught exception while compiling op_backend: ConvolutionBias is only supported with MKLDNN kernel.

	 [[{{node ngraph_cluster_2}}]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "numberwang.py", line 27, in <module>
    },run_metadata=run_metadata,options=options)
  File "/Users/sam/dev/ngraph-bridge/build_cmake/venv-tf-py3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 950, in run
    run_metadata_ptr)
  File "/Users/sam/dev/ngraph-bridge/build_cmake/venv-tf-py3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1173, in _run
    feed_dict_tensor, options, run_metadata)
  File "/Users/sam/dev/ngraph-bridge/build_cmake/venv-tf-py3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1350, in _do_run
    run_metadata)
  File "/Users/sam/dev/ngraph-bridge/build_cmake/venv-tf-py3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1370, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InternalError: Caught exception while compiling op_backend: ConvolutionBias is only supported with MKLDNN kernel.

	 [[{{node ngraph_cluster_2}}]]
@samhodge
Copy link
Author

samhodge commented Jul 4, 2019

About my machine

(venv-tf-py3) kaos-new:ngraph-test sam$ uname -a
Darwin kaos-new.local 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64

(venv-tf-py3) kaos-new:ngraph-test sam$ gcc --version
Configured with: --prefix=/Applications/Xcode9.4.1.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Applications/Xcode9.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

(venv-tf-py3) kaos-new:ngraph-test sam$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.13.6
BuildVersion: 17G65

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

No branches or pull requests

1 participant