niciBume / Cat_Prey_Analyzer

Cat Prey Image-Classification with deeplearning
MIT License
142 stars 22 forks source link

Projekt startet nicht #13

Closed badsche closed 3 years ago

badsche commented 3 years ago

Hallo, vermutlich sitzt hier das Problem vor dem Bildschirm... Nachdem ich auch noch den Telegram Bot installiert bekommen hab starte ich die .sh Datei und bekomme folgenden Output:

sudo /home/pi/CatPreyAnalyzer/catCam_starter.sh Executing CatPreyAnalyzer 2021-01-16 13:41:16.302803: E tensorflow/core/platform/hadoop/hadoop_file_system.cc:132] HadoopFileSystem load error: libhdfs.so: cannot open shared object file: No such file or directory CatCamPy: /home/pi Log Dir: /home/pi/CatPreyAnalyzer/log /home/pi/tensorflow/models/research /home/pi/tensorflow/models/research/object_detection CNN is ready to go! Traceback (most recent call last): File "cascade.py", line 724, in sq_cascade = Sequential_Cascade_Feeder() File "cascade.py", line 75, in init self.base_cascade = Cascade() File "cascade.py", line 417, in init self.pc_stage = PC_Stage() File "/home/pi/CatPreyAnalyzer/model_stages.py", line 269, in init self.pc_model = tf.keras.models.load_model(os.path.join(PC_models_dir, self.pc_model_name)) File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/saving/save.py", line 149, in load_model loader_impl.parse_saved_model(filepath) File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/saved_model/loader_impl.py", line 83, in parse_saved_model constants.SAVED_MODEL_FILENAME_PB)) OSError: SavedModel file does not exist at: /home/pi/CatPreyAnalyzer/models/Prey_Classifier/0.86_512_05_VGG16_ownData_FTfrom15_350_Epochs_2020_05_15_11_40_56.h5/{saved_model.pbtxt|saved_model.pb}

Was fehlt mir noch zu meinem Glück? Super Arbeit übrigens, ich hoffe, dass ich das noch zum Laufen bekomme! Hab zwei Kater, die immer fleißiger Geschenke bringen...

Gruß, badsche

niciBume commented 3 years ago

Hi Badsche,

Anhand von OSError: SavedModel file does not exist at: /home/pi/CatPreyAnalyzer/models/Prey_Classifier/0.86_512_05_VGG16_ownData_FTfrom15_350_Epochs_2020_05_15_11_40_56.h5/{saved_model.pbtxt|saved_model.pb} Glaube ich dass dein directory für das ganze nicht CatPreyAnalyzer heisst sondern Cat_Prey_Analyzer kann das sein? Sorry, hab ich übersehenen ^^

badsche commented 3 years ago

Wow, schnele Antwort @niciBume.Super. Ich hatte ein git Clone gemacht und im Anschluss das Verzeichnis mit mv umbenannt. Die Datei gibt's auch. Dachte evtl. An eine dependecy die fehlt. Weiß aber nicht welche... Was ist mit dem hadoop Fehler? Hab ich was vergessen zu installieren?

Gruß Andreas

niciBume commented 3 years ago

Top! Dann läuft es jetzt? Nein der hadooo fehler ist eine dependency Warnung die ich auch habe ^^

badsche commented 3 years ago

Nein, läuft nicht. Ich hatte nur gedacht es könnte am hadoop Fehler liegen... Dann mach ich evtl nochmal das Setup frisch..

niciBume commented 3 years ago

Hmm too bad. Was ist denn die jetzige Fehlermeldung?

Btw mein system output ist folgender:

pi@raspberrypi:~ $ sudo /home/pi/CatPreyAnalyzer/catCam_starter.sh
Executing CatPreyAnalyzer
2021-01-16 16:57:38.942029: E tensorflow/core/platform/hadoop/hadoop_file_system.cc:132] HadoopFileSystem load error: libhdfs.so: cannot open shared object file: No such file or directory
CatCamPy: /home/pi
Log Dir: /home/pi/CatPreyAnalyzer/log
/home/pi/tensorflow/models/research
/home/pi/tensorflow/models/research/object_detection
WARNING:tensorflow:From /home/pi/tensorflow/models/research/object_detection/utils/label_map_util.py:138: The name tf.gfile.GFile is deprecated. Please use tf.io.gfile.GFile instead.

CNN is ready to go!
WARNING:tensorflow:From /home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/ops/resource_variable_ops.py:1630: calling BaseResourceVariable.__init__ (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.
Instructions for updating:
If using Keras pass *_constraint arguments to layers.
cascade.py:632: TelegramDeprecationWarning: Old Handler API is deprecated - see https://git.io/fxJuV for details
  self.bot_updater = Updater(token=self.BOT_TOKEN)
dummy_img.jpg
CC_time:  9.407999753952026
CC_Do Time: 9.428848505020142
Cat Detected!
Haar_time:  0.15
Overlap:  0.6247896882105722
Face Detected!
Prey Prediction: True
Pred_Val:  0.59
Total Runtime: 13.639735221862793
Runtime: 13.797827959060669
...
...
...
badsche commented 3 years ago

Hm, nach erneuten Setup von Beginn an selbes Ergebnis. Ob sudo oder nicht macht keinen Unterschied...

pi@raspberrypi:~/CatPreyAnalyzer $ ./catCam_starter.sh Executing CatPreyAnalyzer 2021-01-16 17:26:00.449579: E tensorflow/core/platform/hadoop/hadoop_file_system.cc:132] HadoopFileSystem load error: libhdfs.so: cannot open shared object file: No such file or directory CatCamPy: /home/pi Log Dir: /home/pi/CatPreyAnalyzer/log /home/pi/tensorflow/models/research /home/pi/tensorflow/models/research/object_detection CNN is ready to go! Traceback (most recent call last): File "cascade.py", line 724, in <module> sq_cascade = Sequential_Cascade_Feeder() File "cascade.py", line 75, in __init__ self.base_cascade = Cascade() File "cascade.py", line 417, in __init__ self.pc_stage = PC_Stage() File "/home/pi/CatPreyAnalyzer/model_stages.py", line 269, in __init__ self.pc_model = tf.keras.models.load_model(os.path.join(PC_models_dir, self.pc_model_name)) File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/saving/save.py", line 149, in load_model loader_impl.parse_saved_model(filepath) File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/saved_model/loader_impl.py", line 83, in parse_saved_model constants.SAVED_MODEL_FILENAME_PB)) OSError: SavedModel file does not exist at: /home/pi/CatPreyAnalyzer/models/Prey_Classifier/0.86_512_05_VGG16_ownData_FTfrom15_350_Epochs_2020_05_15_11_40_56.h5/{saved_model.pbtxt|saved_model.pb}

Ich werde es weiter versuchen, kein Problem. Dachte es ist evtl. ein schon mal aufgetauchtes Problem. Ich mach das hier mal noch nicht zu, ok? Wenn ich was gefunden hab poste ich es hier.

niciBume commented 3 years ago

Alles klar. Als erstes würde ich überprüfen ob alle directories existeren die im output erwähnt werden... Sonst weisst du ja wo ich zu finden bin ;)

badsche commented 3 years ago

Kurzer Zwischenstand: Liegt wohl an der installierten h5py Version (war 3.1.0). Habe unter https://github.com/tensorflow/tensorflow/issues/35909#issuecomment-577100999 Link eine Lösung gefunden: sudo apt-get install python3-h5py löst den Fehler.

Jetzt bekomme ich einen anderen :( : Traceback (most recent call last): File "cascade.py", line 724, in <module> sq_cascade = Sequential_Cascade_Feeder() File "cascade.py", line 75, in __init__ self.base_cascade = Cascade() File "cascade.py", line 417, in __init__ self.pc_stage = PC_Stage() File "/home/pi/CatPreyAnalyzer/model_stages.py", line 269, in __init__ self.pc_model = tf.keras.models.load_model(os.path.join(PC_models_dir, self.pc_model_name)) File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/saving/save.py", line 146, in load_model return hdf5_format.load_model_from_hdf5(filepath, custom_objects, compile) File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/saving/hdf5_format.py", line 166, in load_model_from_hdf5 model_config = json.loads(model_config.decode('utf-8')) AttributeError: 'str' object has no attribute 'decode'

Das scheint aber auch ein bekanntes Problem zu sein. Habe dann wie hier https://github.com/tensorflow/tensorflow/issues/44467 zu sehen ist...

Ich frickel grade noch rum, aber sudo pip3 install 'h5py==2.10.0' --force-reinstall hat bei mir nicht geholfen. Ich glaub, ich werf die .decode Methodenaufrufe, was wohl auch welche machen musste, auch raus.

Melde mich wenns läuft. Auf jeden Fall gibts hier Probleme mit den Versionen.

badsche commented 3 years ago

Also, habe jetzt aus $HOME/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/saving/hdf5_format.py alles was .decode war rausgeworfen und jetzt scheint es zu laufen. Es lag dann wohl Hauptsächlich an der Version von dem h5py...

Gruß, Andreas