object_detection_tutorial.ipynb detection error
Running tensor flow 1.0 CPU version on Ubuntu 16.04.
Checkout latest models (which fixed a previous test_ckpt download issue). Got following error at end of detection (bear with me the long cut-and-paste):
InvalidArgumentError Traceback (most recent call last)
/home/dsu/tf/local/lib/python2.7/site-packages/tensorflow/python/client/session.pyc in run(self, fetches, feed_dict, options, run_metadata) 765 try: 766 result = self._run(None, fetches, feed_dict, options_ptr, --> 767 run_metadata_ptr) 768 if run_metadata: 769 proto_data = tf_session.TF_GetBuffer(run_metadata_ptr)
/home/dsu/tf/local/lib/python2.7/site-packages/tensorflow/python/client/session.pyc in _run(self, handle, fetches, feed_dict, options, run_metadata) 963 if final_fetches or final_targets: 964 results = self._do_run(handle, final_targets, final_fetches, --> 965 feed_dict_string, options, run_metadata) 966 else: 967 results = []
/home/dsu/tf/local/lib/python2.7/site-packages/tensorflow/python/client/session.pyc in _do_run(self, handle, target_list, fetch_list, feed_dict, options, run_metadata) 1013 if handle is None: 1014 return self._do_call(_run_fn, self._session, feed_dict, fetch_list, -> 1015 target_list, options, run_metadata) 1016 else: 1017 return self._do_call(_prun_fn, self._session, handle, feed_dict,
/home/dsu/tf/local/lib/python2.7/site-packages/tensorflow/python/client/session.pyc in _do_call(self, fn, *args) 1033 except KeyError: 1034 pass -> 1035 raise type(e)(node_def, op, message) 1036 1037 def _extend_graph(self):
InvalidArgumentError: NodeDef mentions attr 'data_format' not in Op<name=DepthwiseConv2dNative; signature=input:T, filter:T -> output:T; attr=T:type,allowed=[DT_FLOAT, DT_DOUBLE]; attr=strides:list(int); attr=padding:string,allowed=["SAME", "VALID"]>; NodeDef: FeatureExtractor/MobilenetV1/MobilenetV1/Conv2d_1_depthwise/depthwise = DepthwiseConv2dNative[T=DT_FLOAT, data_format="NHWC", padding="SAME", strides=[1, 1, 1, 1], _device="/job:localhost/replica:0/task:0/cpu:0"](FeatureExtractor/MobilenetV1/MobilenetV1/Conv2d_0/Relu6, FeatureExtractor/MobilenetV1/Conv2d_1_depthwise/depthwise_weights/read) [[Node: FeatureExtractor/MobilenetV1/MobilenetV1/Conv2d_1_depthwise/depthwise = DepthwiseConv2dNative[T=DT_FLOAT, data_format="NHWC", padding="SAME", strides=[1, 1, 1, 1], _device="/job:localhost/replica:0/task:0/cpu:0"](FeatureExtractor/MobilenetV1/MobilenetV1/Conv2d_0/Relu6, FeatureExtractor/MobilenetV1/Conv2d_1_depthwise/depthwise_weights/read)]]
Caused by op u'FeatureExtractor/MobilenetV1/MobilenetV1/Conv2d_1_depthwise/depthwise', defined at:
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/local/lib/python2.7/dist-packages/ipykernel/main.py", line 3, in
InvalidArgumentError (see above for traceback): NodeDef mentions attr 'data_format' not in Op<name=DepthwiseConv2dNative; signature=input:T, filter:T -> output:T; attr=T:type,allowed=[DT_FLOAT, DT_DOUBLE]; attr=strides:list(int); attr=padding:string,allowed=["SAME", "VALID"]>; NodeDef: FeatureExtractor/MobilenetV1/MobilenetV1/Conv2d_1_depthwise/depthwise = DepthwiseConv2dNative[T=DT_FLOAT, data_format="NHWC", padding="SAME", strides=[1, 1, 1, 1], _device="/job:localhost/replica:0/task:0/cpu:0"](FeatureExtractor/MobilenetV1/MobilenetV1/Conv2d_0/Relu6, FeatureExtractor/MobilenetV1/Conv2d_1_depthwise/depthwise_weights/read) [[Node: FeatureExtractor/MobilenetV1/MobilenetV1/Conv2d_1_depthwise/depthwise = DepthwiseConv2dNative[T=DT_FLOAT, data_format="NHWC", padding="SAME", strides=[1, 1, 1, 1], _device="/job:localhost/replica:0/task:0/cpu:0"](FeatureExtractor/MobilenetV1/MobilenetV1/Conv2d_0/Relu6, FeatureExtractor/MobilenetV1/Conv2d_1_depthwise/depthwise_weights/read)]
It seems that the data_format attribute for the operation was added in Tensorflow v1.1. Could you install a new version of Tensorflow (v 1.1 or above) to see if it resolves your issue?
After upgrade to tensorflow 1.2, it now works fine. Closing the issue.
much thanks!!
In Ubuntu 14.04 ,after upgrade to tensorflow 1.2, still the same problem. Need I try to install Ubuntu 16.04?
Update: It's my python notebook env. wrong setting ; In Ubuntu 14.04 ,after upgrade to tensorflow 1.2 , it now works fine.
@DrChungAlbert try Ubuntu 16.04. If it still fails, could you copy the error output?
when I run the python file with spyder, encountered the following errors. ////////////////////////////////////////////////////////////////////// IPython 6.1.0 -- An enhanced Interactive Python.
runfile('E:/Projects/Tensorflow/example/object_detection/detectobject.py', wdir='E:/Projects/Tensorflow/example/object_detection') Traceback (most recent call last):
File "
File "C:\Program Files\Anaconda3\envs\tensorflow\lib\site-packages\spyder\utils\site\sitecustomize.py", line 688, in runfile execfile(filename, namespace)
File "C:\Program Files\Anaconda3\envs\tensorflow\lib\site-packages\spyder\utils\site\sitecustomize.py", line 101, in execfile exec(compile(f.read(), filename, 'exec'), namespace)
File "E:/Projects/Tensorflow/example/object_detection/detectobject.py", line 106, in
@DrChungAlbert What was the error, Even I am not able to get it to work on tf version 1.2
@hardik124 In Ubuntu 14.04, it's my python notebook env. wrong setting to tf 1.0, the error same as jwnsu's.
If anyone still has a problem then, I guess it's because you have downloaded the wrong model. http://download.tensorflow.org/models/object_detection/ssd_inception_v2_coco_2017_11_17.tar.gz I downloaded this model and it worked.
TimeoutError Traceback (most recent call last) c:\users\innaeli\anaconda3\envs\tfp3.6\lib\urllib\request.py in open(self, fullurl, data) 1756 if data is None: -> 1757 return getattr(self, name)(url) 1758 else:
c:\users\innaeli\anaconda3\envs\tfp3.6\lib\urllib\request.py in open_http(self, url, data) 1935 """Use HTTP protocol.""" -> 1936 return self._open_generic_http(http.client.HTTPConnection, url, data) 1937
c:\users\innaeli\anaconda3\envs\tfp3.6\lib\urllib\request.py in _open_generic_http(self, connection_factory, url, data) 1915 else: -> 1916 http_conn.request("GET", selector, headers=headers) 1917
c:\users\innaeli\anaconda3\envs\tfp3.6\lib\http\client.py in request(self, method, url, body, headers, encode_chunked) 1238 """Send a complete request to the server.""" -> 1239 self._send_request(method, url, body, headers, encode_chunked) 1240
c:\users\innaeli\anaconda3\envs\tfp3.6\lib\http\client.py in _send_request(self, method, url, body, headers, encode_chunked) 1284 body = _encode(body, 'body') -> 1285 self.endheaders(body, encode_chunked=encode_chunked) 1286
c:\users\innaeli\anaconda3\envs\tfp3.6\lib\http\client.py in endheaders(self, message_body, encode_chunked) 1233 raise CannotSendHeader() -> 1234 self._send_output(message_body, encode_chunked=encode_chunked) 1235
c:\users\innaeli\anaconda3\envs\tfp3.6\lib\http\client.py in _send_output(self, message_body, encode_chunked) 1025 del self._buffer[:] -> 1026 self.send(msg) 1027
c:\users\innaeli\anaconda3\envs\tfp3.6\lib\http\client.py in send(self, data) 963 if self.auto_open: --> 964 self.connect() 965 else:
c:\users\innaeli\anaconda3\envs\tfp3.6\lib\http\client.py in connect(self) 935 self.sock = self._create_connection( --> 936 (self.host,self.port), self.timeout, self.source_address) 937 self.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
c:\users\innaeli\anaconda3\envs\tfp3.6\lib\socket.py in create_connection(address, timeout, source_address) 723 if err is not None: --> 724 raise err 725 else:
c:\users\innaeli\anaconda3\envs\tfp3.6\lib\socket.py in create_connection(address, timeout, source_address) 712 sock.bind(source_address) --> 713 sock.connect(sa) 714 # Break explicitly a reference cycle
TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
During handling of the above exception, another exception occurred:
OSError Traceback (most recent call last)
c:\users\innaeli\anaconda3\envs\tfp3.6\lib\urllib\request.py in retrieve(self, url, filename, reporthook, data) 1789 except OSError as msg: 1790 pass -> 1791 fp = self.open(url, data) 1792 try: 1793 headers = fp.info()
c:\users\innaeli\anaconda3\envs\tfp3.6\lib\urllib\request.py in open(self, fullurl, data) 1761 raise 1762 except OSError as msg: -> 1763 raise OSError('socket error', msg).with_traceback(sys.exc_info()[2]) 1764 1765 def open_unknown(self, fullurl, data=None):
c:\users\innaeli\anaconda3\envs\tfp3.6\lib\urllib\request.py in open(self, fullurl, data) 1755 try: 1756 if data is None: -> 1757 return getattr(self, name)(url) 1758 else: 1759 return getattr(self, name)(url, data)
c:\users\innaeli\anaconda3\envs\tfp3.6\lib\urllib\request.py in open_http(self, url, data) 1934 def open_http(self, url, data=None): 1935 """Use HTTP protocol.""" -> 1936 return self._open_generic_http(http.client.HTTPConnection, url, data) 1937 1938 def http_error(self, url, fp, errcode, errmsg, headers, data=None):
c:\users\innaeli\anaconda3\envs\tfp3.6\lib\urllib\request.py in _open_generic_http(self, connection_factory, url, data) 1914 http_conn.request("POST", selector, data, headers) 1915 else: -> 1916 http_conn.request("GET", selector, headers=headers) 1917 1918 try:
c:\users\innaeli\anaconda3\envs\tfp3.6\lib\http\client.py in request(self, method, url, body, headers, encode_chunked) 1237 encode_chunked=False): 1238 """Send a complete request to the server.""" -> 1239 self._send_request(method, url, body, headers, encode_chunked) 1240 1241 def _send_request(self, method, url, body, headers, encode_chunked):
c:\users\innaeli\anaconda3\envs\tfp3.6\lib\http\client.py in _send_request(self, method, url, body, headers, encode_chunked) 1283 # default charset of iso-8859-1. 1284 body = _encode(body, 'body') -> 1285 self.endheaders(body, encode_chunked=encode_chunked) 1286 1287 def getresponse(self):
c:\users\innaeli\anaconda3\envs\tfp3.6\lib\http\client.py in endheaders(self, message_body, encode_chunked) 1232 else: 1233 raise CannotSendHeader() -> 1234 self._send_output(message_body, encode_chunked=encode_chunked) 1235 1236 def request(self, method, url, body=None, headers={}, *,
c:\users\innaeli\anaconda3\envs\tfp3.6\lib\http\client.py in _send_output(self, message_body, encode_chunked) 1024 msg = b"\r\n".join(self._buffer) 1025 del self._buffer[:] -> 1026 self.send(msg) 1027 1028 if message_body is not None:
c:\users\innaeli\anaconda3\envs\tfp3.6\lib\http\client.py in send(self, data) 962 if self.sock is None: 963 if self.auto_open: --> 964 self.connect() 965 else: 966 raise NotConnected()
c:\users\innaeli\anaconda3\envs\tfp3.6\lib\http\client.py in connect(self) 934 """Connect to the host and port specified in init.""" 935 self.sock = self._create_connection( --> 936 (self.host,self.port), self.timeout, self.source_address) 937 self.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) 938
c:\users\innaeli\anaconda3\envs\tfp3.6\lib\socket.py in create_connection(address, timeout, source_address) 722 723 if err is not None: --> 724 raise err 725 else: 726 raise error("getaddrinfo returns an empty list")
c:\users\innaeli\anaconda3\envs\tfp3.6\lib\socket.py in create_connection(address, timeout, source_address) 711 if source_address: 712 sock.bind(source_address) --> 713 sock.connect(sa) 714 # Break explicitly a reference cycle 715 err = None
OSError: [Errno socket error] [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond I am getting the above error while compiling object_detection_tutorial.ipynb file.
Can anyone tell what could be causing this error? I am using windows 10, Anaconda3 and Tensorflow 1.12