ActionAI icon indicating copy to clipboard operation
ActionAI copied to clipboard

Re: Custom Dataset Training

Open SikhaS opened this issue 4 years ago • 7 comments

@smellslikeml
Hi, I am working on detection of custom action recognition using my own dataset however i am unable to train due to some sklearn pipeline error. The error image is attached below. I am using jetson tx2 for the same.

Any help would be appreciated . issue

SikhaS avatar Jan 27 '20 05:01 SikhaS

Hi @SikhaS, It seems like you may be running a different version of TensorRT. We created the engine plan file referenced using JetPack 4.3 released last December, which includes TensorRT version 6.

If this is not the version you're running and don't want to upgrade, you can create your own models/resnet18_baseline_att_224x224_A_epoch_249_trt.pth file by following the notebook from the trt_pose repo.

smellslikeml avatar Jan 28 '20 16:01 smellslikeml

Same @SikhaS issue how did you resolve this problem ?

LesInsidersIA avatar May 22 '20 21:05 LesInsidersIA

Hi, I am currently working on action recognition using my own dataset as well on a Jetson Nano. As mentioned in #28, I believe that a different preprocess method is required to run train_sequential.py. In order to achieve a data set similar to squats_deadlift_stand5.csv in /examples/yogai/data/legday/, I have written another preprocessing file. It has generated a csv to train the model (you can access it here). As I do not really understand the window variable, I've decided to set time steps = 1 instead of = 5 that is similar to the sample data.

My csv data generated is rather different from the squats_deadlift_stand5.csv file:

  • The range of values are different as I have used TRTPoseExtractor instead of PoseExtractor from from transformer.py to generate my data.
  • There are a lot of 0s as certain joints are not detected in some frames (Not planning to tackle this to improve accuracy at this early stage).
  • Difference in time steps resulting in the difference in the number of columns.

I was able to run train_sequential.py to train a model with an accuracy of 0.79. However, I was unable to load the .h5 model in the legday.py file and encountered the following error below.

Traceback (most recent call last):
  File "legday.py", line 80, in <module>
    loaded_model = load_model('models/lstm.h5')
<omitted some error lines here>
ValueError: Unknown initializer: GlorotUniform
GST_ARGUS: Cleaning up

(python3:24635): GStreamer-CRITICAL **: 13:53:52.528: gst_mini_object_set_qdata: assertion 'object != NULL' failed
CONSUMER: Done Success
GST_ARGUS: Done Success

I am able to load the sample yogai legday model and also a model that I have trained with the sample data provided on my Nano. Because of this, I suspect that there is an issue with the way I have generated the data for lstm model training.

Please assist! I would like to know what is the best way to generate a .csv file similar to squats_deadlift_stand5.csv for train_sequential.py. Is there something wrong with the way that I have generated the data on my end? Last, how did you generate the sample data with time steps? Any help is appreciated, thanks in advance.

Edit: Generating time window = 1 does not add any value to a LSTM model and thus, should be avoided.

gohjiayi avatar Jun 15 '20 06:06 gohjiayi

@gohjiayi in legday.py don't forget to set N=1 also. Don't know where come from your error but in my opinion there is a mismatch between your processing .csv file with window = 1 and legday.py file. Also pose_vec_dim = 28 in your case should be = 36. For me I could load with window = 2 and I used it with openpose.

LesInsidersIA avatar Jun 15 '20 08:06 LesInsidersIA

@yosagaf Hi, thank you for your help! In legday.py I changed these few lines N=1, feature_vec = np.zeros(36), ff = np.expand_dims(np.concatenate(list(ffwd_n_avg(q)), axis=0).reshape(36, N), axis=0). Basically changing the window and pose points from 28 to 36. I took that into account when running the processing .csv file as well.

Are you able to share how you have generated your .csv data and run the program? As I'm not very familiar with time steps, I don't really have an idea on how to generate data for window > 1. What differences does it make as one adjusts the window variable, in your case why did you choose window = 2 specifically?

gohjiayi avatar Jun 15 '20 08:06 gohjiayi

I used this repo to generate 36 point and concatenate skeleton data in sequence frame on a csv file with a script to have 36*2 points. See here here, it seem like there is a keras version mismatch.

LesInsidersIA avatar Jun 15 '20 09:06 LesInsidersIA

@yosagaf Nice I managed to solve the keras version mismatch. I'll try out the repo that you have linked, thank you so much for your help.

gohjiayi avatar Jun 15 '20 10:06 gohjiayi