简体   繁体   English

AttributeError:使用tf-faster-rcnn时,“模块”对象没有属性“直方图”

[英]AttributeError: 'module' object has no attribute 'histogram' when using tf-faster-rcnn

Please have a look at this issue and let me know if you know how to fix it? 请查看此问题,如果您知道如何解决,请告诉我。 Here's the link to the original repo: https://github.com/endernewton/tf-faster-rcnn 这是原始回购的链接: https : //github.com/endernewton/tf-faster-rcnn

mona@pascal:~/computer_vision/tf-faster-rcnn$ ./experiments/scripts/test_vgg16.sh $GPU_ID pascal_voc
+ set -e
+ export PYTHONUNBUFFERED=True
+ PYTHONUNBUFFERED=True
+ GPU_ID=0
+ DATASET=pascal_voc
+ array=($@)
+ len=2
+ EXTRA_ARGS=
+ EXTRA_ARGS_SLUG=
+ case ${DATASET} in
+ TRAIN_IMDB=voc_2007_trainval
+ TEST_IMDB=voc_2007_test
+ ITERS=70000
++ date +%Y-%m-%d_%H-%M-%S
+ LOG=experiments/logs/test_vgg16_voc_2007_trainval_.txt.2017-02-13_21-29-30
+ exec
++ tee -a experiments/logs/test_vgg16_voc_2007_trainval_.txt.2017-02-13_21-29-30
tee: experiments/logs/test_vgg16_voc_2007_trainval_.txt.2017-02-13_21-29-30: No such file or directory
+ echo Logging output to experiments/logs/test_vgg16_voc_2007_trainval_.txt.2017-02-13_21-29-30
Logging output to experiments/logs/test_vgg16_voc_2007_trainval_.txt.2017-02-13_21-29-30
+ set +x
+ [[ ! -z '' ]]
+ CUDA_VISIBLE_DEVICES=0
+ time python ./tools/test_vgg16_net.py --imdb voc_2007_test --weight data/imagenet_weights/vgg16.weights --model output/vgg16/voc_2007_trainval/default/vgg16_faster_rcnn_iter_70000.ckpt --cfg experiments/cfgs/vgg16.yml --set
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcublas.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcudnn.so.5.0 locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcufft.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcurand.so.8.0 locally
Called with args:
Namespace(cfg_file='experiments/cfgs/vgg16.yml', comp_mode=False, imdb_name='voc_2007_test', max_per_image=100, model='output/vgg16/voc_2007_trainval/default/vgg16_faster_rcnn_iter_70000.ckpt', set_cfgs=[], tag='', weight='data/imagenet_weights/vgg16.weights')
Using config:
{'DATA_DIR': '/home/mona/computer_vision/tf-faster-rcnn/data',
 'DEDUP_BOXES': 0.0625,
 'EPS': 1e-14,
 'EXP_DIR': 'vgg16',
 'GPU_ID': 0,
 'MATLAB': 'matlab',
 'PIXEL_MEANS': array([[[ 102.9801,  115.9465,  122.7717]]]),
 'POOLING_MODE': 'crop',
 'RNG_SEED': 3,
 'ROOT_DIR': '/home/mona/computer_vision/tf-faster-rcnn',
 'TEST': {'BBOX_REG': True,
          'HAS_RPN': True,
          'MAX_SIZE': 1000,
          'MODE': 'nms',
          'NMS': 0.3,
          'PROPOSAL_METHOD': 'selective_search',
          'RPN_NMS_THRESH': 0.7,
          'RPN_POST_NMS_TOP_N': 300,
          'RPN_PRE_NMS_TOP_N': 6000,
          'RPN_TOP_N': 5000,
          'SCALES': [600],
          'SVM': False},
 'TRAIN': {'ASPECT_GROUPING': False,
           'BATCH_SIZE': 256,
           'BBOX_INSIDE_WEIGHTS': [1.0, 1.0, 1.0, 1.0],
           'BBOX_NORMALIZE_MEANS': [0.0, 0.0, 0.0, 0.0],
           'BBOX_NORMALIZE_STDS': [0.1, 0.1, 0.2, 0.2],
           'BBOX_NORMALIZE_TARGETS': True,
           'BBOX_NORMALIZE_TARGETS_PRECOMPUTED': True,
           'BBOX_REG': True,
           'BBOX_THRESH': 0.5,
           'BG_THRESH_HI': 0.5,
           'BG_THRESH_LO': 0.0,
           'BIAS_DECAY': False,
           'DISPLAY': 20,
           'DOUBLE_BIAS': True,
           'FG_FRACTION': 0.25,
           'FG_THRESH': 0.5,
           'GAMMA': 0.1,
           'HAS_RPN': True,
           'IMS_PER_BATCH': 1,
           'LEARNING_RATE': 0.001,
           'MAX_SIZE': 1000,
           'MOMENTUM': 0.9,
           'PROPOSAL_METHOD': 'gt',
           'RPN_BATCHSIZE': 256,
           'RPN_BBOX_INSIDE_WEIGHTS': [1.0, 1.0, 1.0, 1.0],
           'RPN_CLOBBER_POSITIVES': False,
           'RPN_FG_FRACTION': 0.5,
           'RPN_NEGATIVE_OVERLAP': 0.3,
           'RPN_NMS_THRESH': 0.7,
           'RPN_POSITIVE_OVERLAP': 0.7,
           'RPN_POSITIVE_WEIGHT': -1.0,
           'RPN_POST_NMS_TOP_N': 2000,
           'RPN_PRE_NMS_TOP_N': 12000,
           'SCALES': [600],
           'SNAPSHOT_ITERS': 5000,
           'SNAPSHOT_KEPT': 3,
           'SNAPSHOT_PREFIX': 'vgg16_faster_rcnn',
           'STEPSIZE': 30000,
           'SUMMARY_INTERVAL': 180,
           'TRUNCATED': False,
           'USE_FLIPPED': True,
           'USE_GT': False,
           'WEIGHT_DECAY': 0.0005},
 'USE_GPU_NMS': True}
I tensorflow/core/common_runtime/gpu/gpu_device.cc:951] Found device 0 with properties: 
name: Tesla K40c
major: 3 minor: 5 memoryClockRate (GHz) 0.8755
pciBusID 0000:03:00.0
Total memory: 11.92GiB
Free memory: 11.85GiB
I tensorflow/core/common_runtime/gpu/gpu_device.cc:972] DMA: 0 
I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] 0:   Y 
I tensorflow/core/common_runtime/gpu/gpu_device.cc:1041] Creating TensorFlow device (/gpu:0) -> (device: 0, name: Tesla K40c, pci bus id: 0000:03:00.0)
Loading caffe weights...
Done!
Traceback (most recent call last):
  File "./tools/test_vgg16_net.py", line 89, in <module>
    tag='default', anchor_scales=anchors)
  File "/home/mona/computer_vision/tf-faster-rcnn/tools/../lib/nets/vgg16.py", line 503, in create_architecture
    self._add_score_summary(key, var)
  File "/home/mona/computer_vision/tf-faster-rcnn/tools/../lib/nets/vgg16.py", line 45, in _add_score_summary
    tf.summary.histogram('SCORE/' + tensor.op.name + '/' + key + '/scores', tensor)
AttributeError: 'module' object has no attribute 'histogram'
Command exited with non-zero status 1
5.56user 4.11system 0:07.12elapsed 135%CPU (0avgtext+0avgdata 2082508maxresident)k
0inputs+32outputs (0major+212277minor)pagefaults 0swaps
Environment info

Operating System: 操作系统:

$ uname -a; lsb_release -a
Linux pascal 3.13.0-62-generic #102-Ubuntu SMP Tue Aug 11 14:29:36 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.5 LTS
Release:    14.04
Codename:   trusty
Version of TF:

mona@pascal:~/computer_vision/tf-faster-rcnn$ python -c "import tensorflow; print(tensorflow.__version__)"
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcublas.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcudnn.so.5.0 locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcufft.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcurand.so.8.0 locally
0.10.0

The output of bazel version bazel版本的输出

$ bazel version
Extracting Bazel installation...
Build label: 0.4.3
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Dec 22 12:31:25 2016 (1482409885)
Build timestamp: 1482409885
Build timestamp as int: 1482409885

You are using an older version of tensorflow. 您正在使用旧版的tensorflow。 The old version was tf.histogram_summary . 旧版本为tf.histogram_summary You can see a list of API changes in our upgrade script . 您可以在我们的升级脚本中看到API更改的列表。

According to the answer I got in github issues, I am using a very old version of TensorFlow. 根据我在github问题中得到的答案,我使用的是TensorFlow的非常旧的版本。 This solved the problem: 这样就解决了问题:

$ sudo pip2 install tensorflow-gpu

Or 要么

 $ sudo pip2 install tensorflow

For others. 为他人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Windows上的tf-faster-rcnn - tf-faster-rcnn on Windows AttributeError: module 'object_detection.protos.faster_rcnn_pb2' has no attribute 'AttentionPosition' - 恢复训练时 - AttributeError: module 'object_detection.protos.faster_rcnn_pb2' has no attribute 'AttentionPosition' - upon resuming training AttributeError:运行RCNN train_end2end.py时,“模块”对象没有属性“建议” - AttributeError: 'module' object has no attribute 'Proposal' when running RCNN train_end2end.py AttributeError: &#39;module&#39; 对象没有 tf.app.run() 的属性 &#39;main&#39; - AttributeError: 'module' object has no attribute 'main' for tf.app.run() AttributeError:“模块”对象没有属性(使用cPickle时) - AttributeError: 'module' object has no attribute (when using cPickle) AttributeError:“ socket”上使用pickle时,“模块”对象没有属性“ - AttributeError: 'module' object has no attribute '' when using pickle over sockets “ AttributeError:&#39;模块&#39;对象没有属性&#39;发送&#39;”将套接字用于后门时 - “AttributeError: 'module' object has no attribute 'send'” When using socket for a backdoor AttributeError: &#39;module&#39; 对象没有属性 - AttributeError: 'module' object has no attribute AttributeError:'module'对象没有属性 - AttributeError: 'module' object has no attribute AttributeError: &#39;module&#39; 对象没有属性 - AttributeError: 'module' object has no attribute
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM