2017-02-27 1 views
0

x86 및 ARMv7에서 실행중인 TensorFlow (r1.0)에 대한 새 작업 (https://www.tensorflow.org/extend/adding_an_op)을 생성 중입니다.TensorFlow 새 Op : AttributeError : 'module'객체에 'custom_op'속성이 없습니다.

ARMv7에서 TensorFlow를 실행하려면 마이너 코드 수정이 필요하지만이 가이드는 많은 도움이됩니다. https://github.com/samjabrahams/tensorflow-on-raspberry-pi/blob/master/GUIDE.md.

그러나 나는 사용자 정의 작업이 TensorFlow의 ARMv7 설치에서 작동하지 않는 것으로 나타났습니다.

내가하는 ARMv7에 파이썬 스크립트에서 내 사용자 지정 작업을 테스트 예를 들어

:

import tensorflow as tf 
_custom_op_module = tf.load_op_library('custom_op.so') 
custom_op = _custom_op_module.add_stub 

내가받을 다음과 같은 오류 (즉 86에 표시되지 않음) :

$ python test_custom_op.py 
    Traceback (most recent call last): 
    File "custom_op.py", line 3, in <module> 
    add_stub = _custom_op_module.add_stub 
    AttributeError: 'module' object has no attribute 'custom_op' 

I 더 문제를 조사하고, 분명히 .so 라이브러리 파일에 내 사용자 지정 작업이 없습니다. x86에서

$ python 
>>> import tensorflow as tf 
>>> _custom_op_module = tf.load_op_library('custom_op.so') 
>>> dir(_custom_op_module) 
>>> ['LIB_HANDLE', 'OP_LIST', '_InitOpDefLibrary', '__builtins__', '__doc__', '__name__', '__package__', '_collections', '_common_shapes', '_op_def_lib', '_op_def_library', '_op_def_pb2', '_op_def_registry', '_ops', '_text_format'] 
>>> _custom_op_module.OP_LIST 

>>> 

같은 명령 다음과 같은 출력이 있습니다

>>> import tensorflow as tf 
>>> _custom_op_module = tf.load_op_library('custom_op.so') 
>>> dir(_custom_op_module) 
>>> ['LIB_HANDLE', 'OP_LIST', '_InitOpDefLibrary', '__builtins__', '__doc__', '__name__', '__package__', '_add_stub_outputs', '_collections', '_common_shapes', '_op_def_lib', '_op_def_library', '_op_def_pb2', '_op_def_registry', '_ops', '_text_format', 'custom_op'] 
>>> _custom_op_module.OP_LIST 
op { 
    name: "CustomOp" 
    ... 
} 
>>> 

아무도 유사한 문제가 있습니까를? 우리는 이것을 버그라고 생각할 수 있습니까?

답변

0

분명히 TF를 다시 컴파일하고 다시 설치하면 효과가있었습니다.

관련 문제