dshahrokhian / YOLO_tensorflow

:oncoming_taxi: Object Detection (YOLOv1) implentation in tensorflow, with training, testing and video features.
42 stars 22 forks source link

AttributeError: YOLO_TF instance has no attribute 'result' #2

Closed seongkyun closed 7 years ago

seongkyun commented 7 years ago

I changed YPLO_small_tf.py file tf.global_variables_initializer to tf.initialize_all_variables (because of AttributeError: 'module' object has no attribute 'global_variables_initializer')

and run this code in my terminal.

$ python data_parsing/setup.py install

and it prints out

I tensorflow/core/common_runtime/gpu/gpu_device.cc:951] Found device 0 with properties: name: GeForce GTX 1060 6GB major: 6 minor: 1 memoryClockRate (GHz) 1.7715 pciBusID 0000:01:00.0 Total memory: 5.92GiB Free memory: 5.38GiB 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: GeForce GTX 1060 6GB, pci bus id: 0000:01:00.0) Loading complete!

detection person.jpg image Detect from person.jpg Traceback (most recent call last): File "network/YOLO_small_tf.py", line 515, in yolo = YOLO_TF(sys.argv) File "network/YOLO_small_tf.py", line 67, in init self.detect_from_file(self.fromfile) File "network/YOLO_small_tf.py", line 242, in detect_from_file self.show_results(filename, self.result) AttributeError: YOLO_TF instance has no attribute 'result'

help me friends. I can't find its solution even if at google. ToT

I ran this code on Ubuntu 16.04.3 LTS with CUDA 8.0, cuDNN5.1, opencv 2411, and tensorflow r0.11 and installed whole requirements.(with Anaconda2)

dshahrokhian commented 7 years ago

Can you try updating tensorflow to version 1.0?

Thanks, Dani

seongkyun commented 7 years ago

@dshahrokhian It prints out same error. my tensorflow version is R1.0.1

I wrote $ python network/YOLO_small_tf.py -fromfile "person.jpg" -tofile_img "person_out.jpg"

and it returns

I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcublas.so.8.0 locally I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcudnn.so.5 locally I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcufft.so.8.0 locally I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcuda.so.1 locally I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcurand.so.8.0 locally -fromfile -tofile_img Building YOLO_small graph... Layer 1 : Type = Conv, Size = 7 7, Stride = 2, Filters = 64, Input channels = 3 Layer 2 : Type = Pool, Size = 2 2, Stride = 2 Layer 3 : Type = Conv, Size = 3 3, Stride = 1, Filters = 192, Input channels = 64 Layer 4 : Type = Pool, Size = 2 2, Stride = 2 Layer 5 : Type = Conv, Size = 1 1, Stride = 1, Filters = 128, Input channels = 192 Layer 6 : Type = Conv, Size = 3 3, Stride = 1, Filters = 256, Input channels = 128 Layer 7 : Type = Conv, Size = 1 1, Stride = 1, Filters = 256, Input channels = 256 Layer 8 : Type = Conv, Size = 3 3, Stride = 1, Filters = 512, Input channels = 256 Layer 9 : Type = Pool, Size = 2 2, Stride = 2 Layer 10 : Type = Conv, Size = 1 1, Stride = 1, Filters = 256, Input channels = 512 Layer 11 : Type = Conv, Size = 3 3, Stride = 1, Filters = 512, Input channels = 256 Layer 12 : Type = Conv, Size = 1 1, Stride = 1, Filters = 256, Input channels = 512 Layer 13 : Type = Conv, Size = 3 3, Stride = 1, Filters = 512, Input channels = 256 Layer 14 : Type = Conv, Size = 1 1, Stride = 1, Filters = 256, Input channels = 512 Layer 15 : Type = Conv, Size = 3 3, Stride = 1, Filters = 512, Input channels = 256 Layer 16 : Type = Conv, Size = 1 1, Stride = 1, Filters = 256, Input channels = 512 Layer 17 : Type = Conv, Size = 3 3, Stride = 1, Filters = 512, Input channels = 256 Layer 18 : Type = Conv, Size = 1 1, Stride = 1, Filters = 512, Input channels = 512 Layer 19 : Type = Conv, Size = 3 3, Stride = 1, Filters = 1024, Input channels = 512 Layer 20 : Type = Pool, Size = 2 2, Stride = 2 Layer 21 : Type = Conv, Size = 1 1, Stride = 1, Filters = 512, Input channels = 1024 Layer 22 : Type = Conv, Size = 3 3, Stride = 1, Filters = 1024, Input channels = 512 Layer 23 : Type = Conv, Size = 1 1, Stride = 1, Filters = 512, Input channels = 1024 Layer 24 : Type = Conv, Size = 3 3, Stride = 1, Filters = 1024, Input channels = 512 Layer 25 : Type = Conv, Size = 3 3, Stride = 1, Filters = 1024, Input channels = 1024 Layer 26 : Type = Conv, Size = 3 3, Stride = 2, Filters = 1024, Input channels = 1024 Layer 27 : Type = Conv, Size = 3 3, Stride = 1, Filters = 1024, Input channels = 1024 Layer 28 : Type = Conv, Size = 3 3, Stride = 1, Filters = 1024, Input channels = 1024 Layer 29 : Type = Full, Hidden = 512, Input dimension = 50176, Flat = 1, Activation = 1 Layer 30 : Type = Full, Hidden = 4096, Input dimension = 512, Flat = 0, Activation = 1 Layer 31 : Type = DropOut Layer 32 : Type = Full, Hidden = 1470, Input dimension = 4096, Flat = 0, Activation = 0 W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations. I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:910] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero I tensorflow/core/common_runtime/gpu/gpu_device.cc:885] Found device 0 with properties: name: GeForce GTX 1060 6GB major: 6 minor: 1 memoryClockRate (GHz) 1.7715 pciBusID 0000:01:00.0 Total memory: 5.92GiB Free memory: 5.42GiB I tensorflow/core/common_runtime/gpu/gpu_device.cc:906] DMA: 0 I tensorflow/core/common_runtime/gpu/gpu_device.cc:916] 0: Y I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 1060 6GB, pci bus id: 0000:01:00.0) Loading complete!

detection person.jpg image Detect from person.jpg Traceback (most recent call last): File "network/YOLO_small_tf.py", line 513, in yolo = YOLO_TF(sys.argv) File "network/YOLO_small_tf.py", line 67, in init self.detect_from_file(self.fromfile) File "network/YOLO_small_tf.py", line 241, in detect_from_file self.show_results(filename, self.result) AttributeError: YOLO_TF instance has no attribute 'result'

dshahrokhian commented 7 years ago

Hi,

I made a small change in the code. Can you pull these changes and try again? I don't have a linux distro to test it myself.

Thanks, Dani

seongkyun commented 7 years ago

@dshahrokhian thanks. it solved!