Ошибка AttributeError: '_FieldProperty' object has no attribute 'allow_growth'
Имеется нейросеть для распознавания номерных знаков авто пытаюсь запустить, но выходит ошибка:
AttributeError: '_FieldProperty' object has no attribute 'allow_growth'
Tensorflow ==1.15.2 tensorflow-estimator 1.15.1 tensorflow-gpu == 1.15.2
import os
import cv2
import numpy as np
import sys
import json
import matplotlib.image as mpimg
from matplotlib import pyplot as plt
import warnings
warnings.filterwarnings('ignore')
# change this property
NOMEROFF_NET_DIR = os.path.abspath('../')
# specify the path to Mask_RCNN if you placed it outside Nomeroff-net project
MASK_RCNN_DIR = os.path.join(NOMEROFF_NET_DIR, 'Mask_RCNN')
MASK_RCNN_LOG_DIR = os.path.join(NOMEROFF_NET_DIR, 'logs')
sys.path.append(NOMEROFF_NET_DIR)
# Import license plate recognition tools.
from NomeroffNet import filters
from NomeroffNet import RectDetector
from NomeroffNet import TextDetector
from NomeroffNet import OptionsDetector
from NomeroffNet import Detector
from NomeroffNet import textPostprocessing
from NomeroffNet import textPostprocessingAsync
# Initialize npdetector with default configuration file.
nnet = Detector(MASK_RCNN_DIR, MASK_RCNN_LOG_DIR)
nnet.loadModel("latest")
rectDetector = RectDetector()
optionsDetector = OptionsDetector()
optionsDetector.load("latest")
# Initialize text detector.
textDetector = TextDetector({
"eu_ua_2004_2015": {
"for_regions": ["eu_ua_2015", "eu_ua_2004"],
"model_path": "latest"
},
"eu_ua_1995": {
"for_regions": ["eu_ua_1995"],
"model_path": "latest"
},
"eu": {
"for_regions": ["eu"],
"model_path": "latest"
},
"ru": {
"for_regions": ["ru", "eu-ua-fake-lnr", "eu-ua-fake-dnr"],
"model_path": "latest"
},
"kz": {
"for_regions": ["kz"],
"model_path": "latest"
},
"ge": {
"for_regions": ["ge"],
"model_path": "latest"
}
})
Walking through the ./examples/images/ directory and checking each of the images for license plates.
rootDir = 'images/'
max_img_w = 1600 for dirName, subdirList, fileList in os.walk(rootDir): for fname in fileList: img_path = os.path.join(dirName, fname) print(img_path) img = mpimg.imread(img_path) plt.axis("off") plt.imshow(img) plt.show()
# corect size for better speed
img_w = img.shape[1]
img_h = img.shape[0]
img_w_r = 1
img_h_r = 1
if img_w > max_img_w:
resized_img = cv2.resize(img, (max_img_w, int(max_img_w/img_w*img_h)))
img_w_r = img_w/max_img_w
img_h_r = img_h/(max_img_w/img_w*img_h)
else:
resized_img = img
NP = nnet.detect([resized_img])
# Generate image mask.
cv_img_masks = await filters.cv_img_mask_async(NP)
# Detect points.
arrPoints = await rectDetector.detectAsync(cv_img_masks, outboundHeightOffset=0, fixGeometry=True, fixRectangleAngle=10)
print(arrPoints)
arrPoints[..., 1:2] = arrPoints[..., 1:2]*img_h_r
arrPoints[..., 0:1] = arrPoints[..., 0:1]*img_w_r
# cut zones
zones = await rectDetector.get_cv_zonesBGR_async(img, arrPoints)
toShowZones = await rectDetector.get_cv_zonesRGB_async(img, arrPoints)
for zone, points in zip(toShowZones, arrPoints):
plt.axis("off")
plt.imshow(zone)
plt.show()
# find standart
regionIds, stateIds, countLines = optionsDetector.predict(zones)
regionNames = optionsDetector.getRegionLabels(regionIds)
print(regionNames)
print(countLines)
# find text with postprocessing by standart
textArr = textDetector.predict(zones, regionNames, countLines)
textArr = await textPostprocessingAsync(textArr, regionNames)
print(textArr)
Подскажите, пожалуйста, как исправить