smellslikeml / ActionAI

Real-Time Spatio-Temporally Localized Activity Detection by Tracking Body Keypoints
https://www.hackster.io/actionai/actionai-custom-tracking-multiperson-activity-recognition-fa5cb5
GNU General Public License v3.0
765 stars 191 forks source link

Error while training #37

Open lachose1 opened 3 years ago

lachose1 commented 3 years ago

Hello, I recorded 3 different JPEG sequences of around 300 images each (repeating multiple time a movement, so maybe 20 images per movement multiple times). I ran the preprocess.py and the data seems to be correct in the data/data.csv. Now when I try to run train.py I get this error :

/home/hugo/anaconda3/envs/tensorrt/lib/python3.6/site-packages/sklearn/linear_model/_logistic.py:940: ConvergenceWarning: lbfgs failed to converge (status=1):
STOP: TOTAL NO. of f AND g EVALUATIONS EXCEEDS LIMIT.

Increase the number of iterations (max_iter) or scale the data as shown in:
    https://scikit-learn.org/stable/modules/preprocessing.html
Please also refer to the documentation for alternative solver options:
    https://scikit-learn.org/stable/modules/linear_model.html#logistic-regression
  extra_warning_msg=_LOGISTIC_SOLVER_CONVERGENCE_MSG)

I tried modyfing train.py by modifying this line from

    pipeline = actionModel(config.classifier())

to

    pipeline = actionModel(config.classifier(max_iter=1000000))

Without success.

I also tried reducing the number of pictures if it could help the algorithm. They are 1280x720pixels, so maybe that's the issue? Also for a sequence of event, do I need to run train.py first then train_sequential.py aftewards, or can I just skip directly to train_sequential.py. Right now running the script throws this error :

Traceback (most recent call last):
  File "train_sequential.py", line 60, in <module>
    model = tf.keras.models.load_model('./models/lstm.h5')
  File "/home/hugo/anaconda3/envs/tensorrt/lib/python3.6/site-packages/tensorflow_core/python/keras/saving/save.py", line 149, in load_model
    loader_impl.parse_saved_model(filepath)
  File "/home/hugo/anaconda3/envs/tensorrt/lib/python3.6/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: ./models/lstm.h5/{saved_model.pbtxt|saved_model.pb}

Thanks!

jackweiwang commented 3 years ago

model = tf.keras.models.load_model('./models/lstm.h5') change to model = lstm_model()