TTMRonald / AerialCrackDetection

Use Keras to detect the pavement cracks in aerial images.
40 stars 32 forks source link

Cannot run ./test.py #5

Open salla23 opened 5 years ago

salla23 commented 5 years ago

Hi. I followed the instructions to train the network and it worked without an issue. I used the resnet50 to train the network and then try to execute the ./test.py file, however I am running into the same issue repeatedly:

Traceback (most recent call last): File "test.py", line 50, in config_output_filename = C.config_filename NameError: name 'C' is not defined

I've gone through the train.py file and tried to bring over the same type of declaration used in that file:

C = config.Config()

But even this doesn't seem to be helping me. Does anyone know how I can move past this or did I do something wrong? I will be continue trying to fix this issue over the next couple days and any help would be GREATLY appreciated. I'll also be sure to update my progress, but I've been stuck on this issue for a while now and it is frustrating. Thanks in advance for your help.

garyliu0816 commented 5 years ago

update the code like this, then it may works.

parser.add_option("-p", "--path", dest="test_path", help="Path to test data.",
                default="./dataset")
parser.add_option("-n", "--net", dest="net", help="Network to use one of ZF or VGG16 or GoogleNet or ResNet50 or ResNet101",
                default="ResNet50")
parser.add_option("-b", "--batch_size", dest="batch_size", help="Size of each batch",
                default="16")
C = config.Config()
config_output_filename = C.config_filename

i hope this will help :D

Zongzzlll commented 5 years ago

update the code like this, then it may works.

parser.add_option("-p", "--path", dest="test_path", help="Path to test data.",
              default="./dataset")
parser.add_option("-n", "--net", dest="net", help="Network to use one of ZF or VGG16 or GoogleNet or ResNet50 or ResNet101",
              default="ResNet50")
parser.add_option("-b", "--batch_size", dest="batch_size", help="Size of each batch",
              default="16")
C = config.Config()
config_output_filename = C.config_filename

i hope this will help :D

Why am I running according to your suggestion without error, but it will not produce results, why is it? Thank you

The results are as follows {0: 'horizontal crack', 1: 'longitudinal cracks', 2: 'bg'} 2019-09-17 14:08:33.788418: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 2019-09-17 14:08:33.894179: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:898] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2019-09-17 14:08:33.894536: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1212] Found device 0 with properties: name: GeForce GTX 1080 major: 6 minor: 1 memoryClockRate(GHz): 1.7335 pciBusID: 0000:01:00.0 totalMemory: 7.92GiB freeMemory: 7.39GiB 2019-09-17 14:08:33.894550: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1312] Adding visible gpu devices: 0 2019-09-17 14:08:34.109567: I tensorflow/core/common_runtime/gpu/gpu_device.cc:993] Creating TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 7142 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1080, pci bus id: 0000:01:00.0, compute capability: 6.1)

garyliu0816 commented 5 years ago

update the code like this, then it may works.

parser.add_option("-p", "--path", dest="test_path", help="Path to test data.",
                default="./dataset")
parser.add_option("-n", "--net", dest="net", help="Network to use one of ZF or VGG16 or GoogleNet or ResNet50 or ResNet101",
                default="ResNet50")
parser.add_option("-b", "--batch_size", dest="batch_size", help="Size of each batch",
                default="16")
C = config.Config()
config_output_filename = C.config_filename

i hope this will help :D

Why am I running according to your suggestion without error, but it will not produce results, why is it? Thank you

The results are as follows {0: 'horizontal crack', 1: 'longitudinal cracks', 2: 'bg'} 2019-09-17 14:08:33.788418: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 2019-09-17 14:08:33.894179: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:898] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2019-09-17 14:08:33.894536: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1212] Found device 0 with properties: name: GeForce GTX 1080 major: 6 minor: 1 memoryClockRate(GHz): 1.7335 pciBusID: 0000:01:00.0 totalMemory: 7.92GiB freeMemory: 7.39GiB 2019-09-17 14:08:33.894550: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1312] Adding visible gpu devices: 0 2019-09-17 14:08:34.109567: I tensorflow/core/common_runtime/gpu/gpu_device.cc:993] Creating TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 7142 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1080, pci bus id: 0000:01:00.0, compute capability: 6.1)

Maybe the project is only the original version, the improved version is not open. If you want to reproduce results,you'd better contact the author.

muyihao commented 2 years ago

Did you get the dataset in the author's link, can you share it?