本文主要是介绍Tensorflow r0.11的tf.gfile.Glob()错误,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
在测试 Tensorflow 时遇到问题:
通过 TF-slim 模块进行测试,使用 TFRecords 格式的数据集,训练脚本如下:
pythontrain_image_classifier.py --dataset_dir=/home/docker/imagenet_tfrecords/imagenet_tfrecords/train--dataset_name=imagenet_224 --dataset_split_name=train--model_name=inception_v1 --num_clones=1 --batch_size=128 --learning_rate=0.01--max_number_of_steps=200 --num_readers=2 --num_preprocessing_threads=16--preprocessing_name=lenet
出现了 ***Error in `python': munmap_chunk(): invalid pointer: 0x00007f2a50512760 *** 的错误,具体的 Backtrace 最后附 。
经查找后是程序在并行读取文件时出错 data_files =gfile.Glob(data_sources)
/lib/python2.7/site-packages/tensorflow/contrib/slim/python/slim/data/parallel_reader.py
if '*' indata_sources or '?' in data_sources or '[' in data_sources:data_files =gfile.Glob(data_sources)
原因
此问题是由TF不同版本的Python API差异性导致的。Tensorflow r0.11未支持tf.gfile.Glob()
Backtrace :
*** Error in `python': munmap_chunk(): invalid pointer: 0x00007f07b775a760 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7bc67)[0x7f07b6a71c67]
/lib64/ld-linux-x86-64.so.2(_dl_deallocate_tls+0x39)[0x7f07b7ab3fe9]
/lib64/libpthread.so.0(+0x6e07)[0x7f07b74c6e07]
/lib64/libpthread.so.0(+0x6f1f)[0x7f07b74c6f1f]
/lib64/libpthread.so.0(pthread_join+0xe3)[0x7f07b74c8f63]
/lib64/libstdc++.so.6(_ZNSt6thread4joinEv+0x27)[0x7f07001be1f7]
/home/docker/tensorflow-0.11/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so(+0x272d560)[0x7f0709aaf560]
/home/docker/tensorflow-0.11/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so(_ZN10tensorflow6thread10ThreadPool4ImplD0Ev+0xd3)[0x7f0709a83383]
/home/docker/tensorflow-0.11/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so(_ZN10tensorflow10FileSystem16GetMatchingPathsERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPSt6vectorIS6_SaIS6_EE+0x6f4)[0x7f0709aab6e4]
/home/docker/tensorflow-0.11/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so(_ZN10tensorflow3Env16GetMatchingPathsERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPSt6vectorIS6_SaIS6_EE+0xeb)[0x7f0709aa688b]
/home/docker/tensorflow-0.11/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so(+0x9cbf1b)[0x7f0707d4df1b]
/home/docker/tensorflow-0.11/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so(+0x9cf4c2)[0x7f0707d514c2]
/lib64/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x4594)[0x7f07b77bcb94]
/lib64/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7ed)[0x7f07b77be1ad]
/lib64/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x425f)[0x7f07b77bc85f]
/lib64/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7ed)[0x7f07b77be1ad]
/lib64/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x425f)[0x7f07b77bc85f]
/lib64/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7ed)[0x7f07b77be1ad]
/lib64/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x425f)[0x7f07b77bc85f]
/lib64/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7ed)[0x7f07b77be1ad]
/lib64/libpython2.7.so.1.0(+0x6f18d)[0x7f07b774b18d]
/lib64/libpython2.7.so.1.0(PyObject_Call+0x43)[0x7f07b7726073]
/lib64/libpython2.7.so.1.0(+0x59085)[0x7f07b7735085]
/lib64/libpython2.7.so.1.0(PyObject_Call+0x43)[0x7f07b7726073]
/lib64/libpython2.7.so.1.0(+0xa1167)[0x7f07b777d167]
/lib64/libpython2.7.so.1.0(+0x9fe7f)[0x7f07b777be7f]
/lib64/libpython2.7.so.1.0(PyObject_Call+0x43)[0x7f07b7726073]
/lib64/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x1d4c)[0x7f07b77ba34c]
/lib64/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7ed)[0x7f07b77be1ad]
/lib64/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x425f)[0x7f07b77bc85f]
/lib64/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7ed)[0x7f07b77be1ad]
/lib64/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x425f)[0x7f07b77bc85f]
/lib64/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7ed)[0x7f07b77be1ad]
/lib64/libpython2.7.so.1.0(PyEval_EvalCode+0x32)[0x7f07b77be2b2]
/lib64/libpython2.7.so.1.0(+0xfb6ef)[0x7f07b77d76ef]
/lib64/libpython2.7.so.1.0(PyRun_FileExFlags+0x7e)[0x7f07b77d88ae]
/lib64/libpython2.7.so.1.0(PyRun_SimpleFileExFlags+0xe9)[0x7f07b77d9b39]
/lib64/libpython2.7.so.1.0(Py_Main+0xc9f)[0x7f07b77eab3f]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7f07b6a17af5]
python[0x400721]
======= Memory map: ========
00400000-00401000 r-xp 00000000 00:24 144475053 /home/docker/tensorflow-0.11/bin/python
00600000-00601000 r--p 00000000 00:24 144475053 /home/docker/tensorflow-0.11/bin/python
00601000-00602000 rw-p 00001000 00:24 144475053 /home/docker/tensorflow-0.11/bin/python
024dd000-05a40000 rw-p 00000000 00:00 0 [heap]
7f06d0000000-7f06d0021000 rw-p 00000000 00:00 0
7f06d0021000-7f06d4000000 ---p 00000000 00:00 0
7f06d8000000-7f06d8021000 rw-p 00000000 00:00 0
7f06d8021000-7f06dc000000 ---p 00000000 00:00 0
7f06dc000000-7f06dc021000 rw-p 00000000 00:00 0
7f06dc021000-7f06e0000000 ---p 00000000 00:00 0
7f06e0000000-7f06e0021000 rw-p 00000000 00:00 0
7f06e0021000-7f06e4000000 ---p 00000000 00:00 0
7f06e8000000-7f06e8021000 rw-p 00000000 00:00 0
7f06e8021000-7f06ec000000 ---p 00000000 00:00 0
7f06ec000000-7f06ec021000 rw-p 00000000 00:00 0
7f06ec021000-7f06f0000000 ---p 00000000 00:00 0
7f06f0000000-7f06f0021000 rw-p 00000000 00:00 0
7f06f0021000-7f06f4000000 ---p 00000000 00:00 0
7f06f8000000-7f06f8021000 rw-p 00000000 00:00 0
7f06f8021000-7f06fc000000 ---p 00000000 00:00 0
7f06ff6c9000-7f06ff6d2000 r-xp 00000000 08:03 1074458532 /usr/lib64/python2.7/lib-dynload/arraymodule.so
7f06ff6d2000-7f06ff8d1000 ---p 00009000 08:03 1074458532 /usr/lib64/python2.7/lib-dynload/arraymodule.so
7f06ff8d1000-7f06ff8d2000 r--p 00008000 08:03 1074458532 /usr/lib64/python2.7/lib-dynload/arraymodule.so
7f06ff8d2000-7f06ff8d4000 rw-p 00009000 08:03 1074458532 /usr/lib64/python2.7/lib-dynload/arraymodule.so
7f06ff8d4000-7f06ff8dc000 r-xp 00000000 08:03 1074458522 /usr/lib64/python2.7/lib-dynload/_json.so
7f06ff8dc000-7f06ffadb000 ---p 00008000 08:03 1074458522 /usr/lib64/python2.7/lib-dynload/_json.so
7f06ffadb000-7f06ffadc000 r--p 00007000 08:03 1074458522 /usr/lib64/python2.7/lib-dynload/_json.so
7f06ffadc000-7f06ffadd000 rw-p 00008000 08:03 1074458522 /usr/lib64/python2.7/lib-dynload/_json.so
7f06ffadd000-7f06ffae8000 r-xp 00000000 08:03 1074458554 /usr/lib64/python2.7/lib-dynload/parsermodule.so
7f06ffae8000-7f06ffce7000 ---p 0000b000 08:03 1074458554 /usr/lib64/python2.7/lib-dynload/parsermodule.so
7f06ffce7000-7f06ffce8000 r--p 0000a000 08:03 1074458554 /usr/lib64/python2.7/lib-dynload/parsermodule.so
7f06ffce8000-7f06ffce9000 rw-p 0000b000 08:03 1074458554 /usr/lib64/python2.7/lib-dynload/parsermodule.so
7f06ffce9000-7f06ffced000 r-xp 00000000 08:03 1074458599 /usr/lib64/python2.7/lib-dynload/zlibmodule.so
7f06ffced000-7f06ffeec000 ---p 00004000 08:03 1074458599 /usr/lib64/python2.7/lib-dynload/zlibmodule.so
7f06ffeec000-7f06ffeed000 r--p 00003000 08:03 1074458599 /usr/lib64/python2.7/lib-dynload/zlibmodule.so
7f06ffeed000-7f06ffeef000 rw-p 00004000 08:03 1074458599 /usr/lib64/python2.7/lib-dynload/zlibmodule.so
7f06ffeef000-7f06fff04000 r-xp 00000000 08:03 2149358536 /usr/lib64/libgcc_s-4.8.3-20140911.so.1
7f06fff04000-7f0700103000 ---p 00015000 08:03 2149358536 /usr/lib64/libgcc_s-4.8.3-20140911.so.1
7f0700103000-7f0700104000 r--p 00014000 08:03 2149358536 /usr/lib64/libgcc_s-4.8.3-20140911.so.1
7f0700104000-7f0700105000 rw-p 00015000 08:03 2149358536 /usr/lib64/libgcc_s-4.8.3-20140911.so.1
7f0700105000-7f0700276000 r-xp 00000000 08:03 2156207962 /usr/lib64/libstdc++.so.6
7f0700276000-7f0700476000 ---p 00171000 08:03 2156207962 /usr/lib64/libstdc++.so.6
7f0700476000-7f0700480000 r--p 00171000 08:03 2156207962 /usr/lib64/libstdc++.so.6
7f0700480000-7f0700482000 rw-p 0017b000 08:03 2156207962 /usr/lib64/libstdc++.so.6
7f0700482000-7f0700486000 rw-p 00000000 00:00 0
7f0700486000-7f07005ef000 r-xp 00000000 00:24 165905089 /home/docker/tensorflow-0.11/lib/python2.7/site-packages/_solib_k8/_U_S_Sthird_Uparty_Smkl_Cintel_Ubinary_Ublob___Uthird_Uparty_Smkl/libiomp5.so
7f07005ef000-7f07007ef000 ---p 00169000 00:24 165905089 /home/docker/tensorflow-0.11/lib/python2.7/site-packages/_solib_k8/_U_S_Sthird_Uparty_Smkl_Cintel_Ubinary_Ublob___Uthird_Uparty_Smkl/libiomp5.so
7f07007ef000-7f07007fa000 rw-p 00169000 00:24 165905089 /home/docker/tensorflow-0.11/lib/python2.7/site-packages/_solib_k8
这篇关于Tensorflow r0.11的tf.gfile.Glob()错误的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!