FireNET
FireNET copied to clipboard
problem with loadmodel
First of all, I want to thank you for sharing this code. When I compile the code, I face 2 errors in detector.loadModel()
The main function is this : detection_model_json = json.load(open(self._detection_config_json_path)) Lines 911 and 642 in init.py file
what is the reason for this error?
I changed the lines in detect_from_video() function like this :
detector.setModelPath(detection_model_path=os.path.join("F:\PROJECTS\fire detection python\FireNET-master\pretrained-yolov3.h5", "detection_model-ex-33--loss-4.97.h5"))
detector.setJsonPath(configuration_json=os.path.join("F:\PROJECTS\fire detection python\FireNET-master\detection_config.json", "detection_config.json"))
What errors did you face?
Thank you for your reply. Your program contains 3 functions. First of all, I run train_detection_model() and I got these :
Using TensorFlow backend.
Generating anchor boxes for training images and annotation...
Traceback (most recent call last):
File "fire_net.py", line 45, in
As I understand from the code, first I have to tun train_detection_model() and after that, I can use one of two other functions. Am I right?
This is the code I use : from imageai.Detection.Custom import CustomObjectDetection, CustomVideoObjectDetection
import os
execution_path = os.getcwd()
from imageai.Detection.Custom import DetectionModelTrainer
trainer = DetectionModelTrainer()
trainer.setModelTypeAsYOLOv3()
trainer.setDataDirectory(data_directory="fire-dataset")
trainer.setTrainConfig(object_names_array=["fire"], batch_size=8, num_experiments=100,
train_from_pretrained_model="pretrained-yolov3.h5")
# download 'pretrained-yolov3.h5' from the link below
# https://github.com/OlafenwaMoses/ImageAI/releases/download/essential-v4/pretrained-yolov3.h5
trainer.trainModel()
Please visit the article linked below and ensure your organize your dataset folder as specified in the article.
https://medium.com/deepquestai/train-object-detection-ai-with-6-lines-of-code-6d087063f6ff
Hi again Sorry, one of my friends passed away and I wasn't in a good mood. Today I started reading the link you posted. I read the article. in the codes, I don't know how to change this line :
trainer.setDataDirectory(data_directory="hololens")
I have datasets for fire as you mentioned in the article, and what I have to write instead of "hololens"? I will appreciate if you help me in changing these two lines :
trainer.setDataDirectory(data_directory="hololens")
trainer.setTrainConfig(object_names_array=["hololens"], batch_size=4, num_experiments=100, train_from_pretrained_model="pretrained-yolov3.h5")
Hello. I also found your code interesting for a project I'm involved into, I am trying to recognize fire from the data obtained from a infrared-camera.
But I tried to compile the first function and this error surged:
File "D:\Anaconda\lib\site-packages\imageai\Detection\Custom\yolo.py", line 24, in init cell_x = tf.to_float(tf.reshape(tf.tile(tf.range(max_grid_w), [max_grid_h]), (1, max_grid_h, max_grid_w, 1, 1)))
AttributeError: module 'tensorflow' has no attribute 'to_float'
I´m working from Anaconda, and I tried to downgrade tensorflow but it doesn't seem to work. Someone could help me understand what is happening please?
@VictoriaNavarrete I am having the same issue.. did you manage to solve it??
@VictoriaNavarrete I am having the same issue.. did you manage to solve it??
Unfortunately no
Hi. I think the problem was that I had to downgrade my Tensorflow version to 1.15.2. Also I installed ImageAI with pip comand and upgraded.
El jue., 12 mar. 2020 17:18, Hamed [email protected] escribió:
@VictoriaNavarrete https://github.com/VictoriaNavarrete I am having the same issue.. did you manage to solve it??
Unfortunately no
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OlafenwaMoses/FireNET/issues/1#issuecomment-598278053, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANF3G4RULW6GHRCFR5HAISTRHEDPDANCNFSM4JAFTEPQ .
Does the problem solved with that?
This one specificaly for me at least.
El jue., 12 mar. 2020 17:27, Hamed [email protected] escribió:
Does the problem solved with that?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OlafenwaMoses/FireNET/issues/1#issuecomment-598282337, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANF3G4VSXWDD7VWQHDMDTMDRHEENVANCNFSM4JAFTEPQ .
You mean by downgrading tensorflow and installing imageai the problem will solve?