ActionAI icon indicating copy to clipboard operation
ActionAI copied to clipboard

Issue in init of motionclassifier

Open agunapal opened this issue 5 years ago • 5 comments

Could you please clarify what this part of code is doing. There are no files with the prefix "motion_" in the models directory.

self.motion_path = sorted(glob('./models/motion_*'))[-1] self.N = int(os.path.splitext(self.motion_path)[0].split('_')[-1]) self.motion_model = load_model(self.motion_path)

agunapal avatar May 02 '19 21:05 agunapal

i am facing the same problem. i guess it is referring to "motion.h5" with underscore in it.. "motion_.h5". Even if i am correcting that, i am getting some error in "self.N".

INFO: Initialized TensorFlow Lite runtime.
Traceback (most recent call last):
  File "demo.py", line 127, in <module>
    mC = motionClassifier()
  File "demo.py", line 29, in __init__
    self.N = int(os.path.splitext(self.motion_path)[0].split('_')[-1])
ValueError: invalid literal for int() with base 10: ''

@smellslikeml can you help me with this. Screenshot 2019-10-06 at 8 46 41 PM

ganeshmani avatar Oct 06 '19 15:10 ganeshmani

@agunapal @ganeshmani @smellslikeml i am getting this error "UnicodeDecodeError: 'ascii' codec can't decode byte 0x93 in position 1: ordinal not in range(128)" when i run " python3 inference.py" on cpu

abhigoku10 avatar Jan 22 '20 04:01 abhigoku10

@abhigoku10 have you trained your own model using the train.py script? Suspecting you may have tried running a pickled model that was trained on a different machine. I think you should delete that model (models/classifier.sav) and train your own so that it can be pickled and decoded correctly.

smellslikeml avatar Jan 22 '20 04:01 smellslikeml

@smellslikeml i have not trained on my own , i am still running your example model for that only i am facing the issues

abhigoku10 avatar Jan 22 '20 05:01 abhigoku10

@abhigoku10 That model was a placeholder - I've deleted it to avoid confusion. For the inference.py script to work, you need to train your own model using the preprocess.py script and then running the train.py script on your own directories of images. Then you will have your own models/classifier.sav pickled model to run on your device.

The placeholder model doesn't work because pickled models can't be run on different machines from which they were created.

smellslikeml avatar Jan 22 '20 14:01 smellslikeml