{
  "id": 413385,
  "title": "🆘 / submission scoring error ] 5 consecutive submission scoring errors...",
  "url": "/competitions/asl-fingerspelling/discussion/413385",
  "author_name": "canlion",
  "post_date": "2023-05-28T12:07:26.613000",
  "votes": 0,
  "comment_count": 2,
  "views": 0,
  "content": "<p>hello, I hope everyone enjoys the game in this competition as well, following the previous ASLR competition.<br>\nbut I'm not able to enjoy it.</p>\n<p>5 consecutive submission scoring errors…<br>\n🆘 help me</p>\n<p>I'm currently trying to create a simple model using 1D convolution to see if it can be used for scoring.</p>\n<ul>\n<li>input - only hands(x, y, z) / shape: (n_frames, 126) (126 = 21 * 2 * 3)</li>\n<li>after preprocessing - shape: (n_frames, 42, 2) , use x, y</li>\n<li>model: dense(=linear=fully-connected) - relu - conv - bn - relu - … - conv</li>\n</ul>\n<p>The model can be converted to the TFLite format and operates as follows.</p>\n<p><strong>data load - selected_columns json</strong></p>\n<pre><code> json\n\n (, )  f:\n    load_cols_json = json.load(f)\n\nselected_columns = load_cols_json[]\n🌟&gt;&gt;&gt; [, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ]\n</code></pre>\n<p><strong>data load - load parquet file</strong></p>\n<pre><code> ():\n     pd.read_parquet(pq_path, columns=selected_columns)\n\ndata_path = \nframes = load_relevant_data_subset(data_path).values\n\n(frames.shape, frames.dtype)\n🌟&gt;&gt;&gt; (, ) float32\n</code></pre>\n<p><strong>tflite inference</strong></p>\n<pre><code> tflite_runtime.interpreter  tflite\ninterpreter = tflite.Interpreter(model_path)\n\n  (, )  f:\n    character_map = json.load(f)\nrev_character_map = {j:i  i,j  character_map.items()}\n\nframes_infer = frames[:]  \n()\n🌟&gt;&gt;&gt; inputs - shape: (, ) / dtype: float32\n\nprediction_fn = interpreter.get_signature_runner()\noutput = prediction_fn(inputs=frames_infer)\n()\n🌟&gt;&gt;&gt; outputs - shape: (, ) / dtype: float32\n\nprediction_str = .join([rev_character_map.get(s, )  s  np.argmax(output[], axis=)])\n()\n🌟&gt;&gt;&gt; prediction:                                                                -                               \ns\n</code></pre>\n<p><strong>submission.zip</strong></p>\n<pre><code>!zip submission.zip inference_args.json test_model.tflite\n</code></pre>\n<p>It appears that the TFLite model adheres to the input and output formats required in this competition.<br>\nBut I continue to experience scoring errors, and I'm unable to identify the specific mistake I've made. <br>\nI need help. <br>\nThank you.</p>",
  "messages": [
    {
      "id": 2351446,
      "postDate": "2023-07-20T06:38:10.887Z",
      "content": "<p>Can you show me how to fix this bug???</p>",
      "rawMarkdown": "Can you show me how to fix this bug???"
    },
    {
      "id": 2278167,
      "postDate": "2023-05-28T12:07:26.613Z",
      "content": "<p>hello, I hope everyone enjoys the game in this competition as well, following the previous ASLR competition.<br>\nbut I'm not able to enjoy it.</p>\n<p>5 consecutive submission scoring errors…<br>\n🆘 help me</p>\n<p>I'm currently trying to create a simple model using 1D convolution to see if it can be used for scoring.</p>\n<ul>\n<li>input - only hands(x, y, z) / shape: (n_frames, 126) (126 = 21 * 2 * 3)</li>\n<li>after preprocessing - shape: (n_frames, 42, 2) , use x, y</li>\n<li>model: dense(=linear=fully-connected) - relu - conv - bn - relu - … - conv</li>\n</ul>\n<p>The model can be converted to the TFLite format and operates as follows.</p>\n<p><strong>data load - selected_columns json</strong></p>\n<pre><code> json\n\n (, )  f:\n    load_cols_json = json.load(f)\n\nselected_columns = load_cols_json[]\n🌟&gt;&gt;&gt; [, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ]\n</code></pre>\n<p><strong>data load - load parquet file</strong></p>\n<pre><code> ():\n     pd.read_parquet(pq_path, columns=selected_columns)\n\ndata_path = \nframes = load_relevant_data_subset(data_path).values\n\n(frames.shape, frames.dtype)\n🌟&gt;&gt;&gt; (, ) float32\n</code></pre>\n<p><strong>tflite inference</strong></p>\n<pre><code> tflite_runtime.interpreter  tflite\ninterpreter = tflite.Interpreter(model_path)\n\n  (, )  f:\n    character_map = json.load(f)\nrev_character_map = {j:i  i,j  character_map.items()}\n\nframes_infer = frames[:]  \n()\n🌟&gt;&gt;&gt; inputs - shape: (, ) / dtype: float32\n\nprediction_fn = interpreter.get_signature_runner()\noutput = prediction_fn(inputs=frames_infer)\n()\n🌟&gt;&gt;&gt; outputs - shape: (, ) / dtype: float32\n\nprediction_str = .join([rev_character_map.get(s, )  s  np.argmax(output[], axis=)])\n()\n🌟&gt;&gt;&gt; prediction:                                                                -                               \ns\n</code></pre>\n<p><strong>submission.zip</strong></p>\n<pre><code>!zip submission.zip inference_args.json test_model.tflite\n</code></pre>\n<p>It appears that the TFLite model adheres to the input and output formats required in this competition.<br>\nBut I continue to experience scoring errors, and I'm unable to identify the specific mistake I've made. <br>\nI need help. <br>\nThank you.</p>",
      "rawMarkdown": "hello, I hope everyone enjoys the game in this competition as well, following the previous ASLR competition.\nbut I'm not able to enjoy it.\n\n5 consecutive submission scoring errors...\n🆘 help me\n\nI'm currently trying to create a simple model using 1D convolution to see if it can be used for scoring.\n\n- input - only hands(x, y, z) / shape: (n_frames, 126) (126 = 21 * 2 * 3)\n- after preprocessing - shape: (n_frames, 42, 2) , use x, y\n- model: dense(=linear=fully-connected) - relu - conv - bn - relu - ... - conv\n\nThe model can be converted to the TFLite format and operates as follows.\n\n**data load - selected_columns json**\n```python\nimport json\n\nwith open('inference_args.json', 'r') as f:\n    load_cols_json = json.load(f)\n\nselected_columns = load_cols_json['selected_columns']\n🌟>>> ['x_left_hand_0', 'x_left_hand_1', 'x_left_hand_2', 'x_left_hand_3', 'x_left_hand_4', 'x_left_hand_5', 'x_left_hand_6', 'x_left_hand_7', 'x_left_hand_8', 'x_left_hand_9', 'x_left_hand_10', 'x_left_hand_11', 'x_left_hand_12', 'x_left_hand_13', 'x_left_hand_14', 'x_left_hand_15', 'x_left_hand_16', 'x_left_hand_17', 'x_left_hand_18', 'x_left_hand_19', 'x_left_hand_20', 'x_right_hand_0', 'x_right_hand_1', 'x_right_hand_2', 'x_right_hand_3', 'x_right_hand_4', 'x_right_hand_5', 'x_right_hand_6', 'x_right_hand_7', 'x_right_hand_8', 'x_right_hand_9', 'x_right_hand_10', 'x_right_hand_11', 'x_right_hand_12', 'x_right_hand_13', 'x_right_hand_14', 'x_right_hand_15', 'x_right_hand_16', 'x_right_hand_17', 'x_right_hand_18', 'x_right_hand_19', 'x_right_hand_20', 'y_left_hand_0', 'y_left_hand_1', 'y_left_hand_2', 'y_left_hand_3', 'y_left_hand_4', 'y_left_hand_5', 'y_left_hand_6', 'y_left_hand_7', 'y_left_hand_8', 'y_left_hand_9', 'y_left_hand_10', 'y_left_hand_11', 'y_left_hand_12', 'y_left_hand_13', 'y_left_hand_14', 'y_left_hand_15', 'y_left_hand_16', 'y_left_hand_17', 'y_left_hand_18', 'y_left_hand_19', 'y_left_hand_20', 'y_right_hand_0', 'y_right_hand_1', 'y_right_hand_2', 'y_right_hand_3', 'y_right_hand_4', 'y_right_hand_5', 'y_right_hand_6', 'y_right_hand_7', 'y_right_hand_8', 'y_right_hand_9', 'y_right_hand_10', 'y_right_hand_11', 'y_right_hand_12', 'y_right_hand_13', 'y_right_hand_14', 'y_right_hand_15', 'y_right_hand_16', 'y_right_hand_17', 'y_right_hand_18', 'y_right_hand_19', 'y_right_hand_20', 'z_left_hand_0', 'z_left_hand_1', 'z_left_hand_2', 'z_left_hand_3', 'z_left_hand_4', 'z_left_hand_5', 'z_left_hand_6', 'z_left_hand_7', 'z_left_hand_8', 'z_left_hand_9', 'z_left_hand_10', 'z_left_hand_11', 'z_left_hand_12', 'z_left_hand_13', 'z_left_hand_14', 'z_left_hand_15', 'z_left_hand_16', 'z_left_hand_17', 'z_left_hand_18', 'z_left_hand_19', 'z_left_hand_20', 'z_right_hand_0', 'z_right_hand_1', 'z_right_hand_2', 'z_right_hand_3', 'z_right_hand_4', 'z_right_hand_5', 'z_right_hand_6', 'z_right_hand_7', 'z_right_hand_8', 'z_right_hand_9', 'z_right_hand_10', 'z_right_hand_11', 'z_right_hand_12', 'z_right_hand_13', 'z_right_hand_14', 'z_right_hand_15', 'z_right_hand_16', 'z_right_hand_17', 'z_right_hand_18', 'z_right_hand_19', 'z_right_hand_20']\n```\n\n**data load - load parquet file**\n```python\ndef load_relevant_data_subset(pq_path):\n    return pd.read_parquet(pq_path, columns=selected_columns)\n\ndata_path = \"/jws/kaggle/input/asl-fingerspelling/train_landmarks/1019715464.parquet\"\nframes = load_relevant_data_subset(data_path).values\n\nprint(frames.shape, frames.dtype)\n🌟>>> (161722, 126) float32\n```\n\n\n**tflite inference**\n```python\nimport tflite_runtime.interpreter as tflite\ninterpreter = tflite.Interpreter(model_path)\n\nwith open (\"/jws/kaggle/input/asl-fingerspelling/character_to_prediction_index.json\", \"r\") as f:\n    character_map = json.load(f)\nrev_character_map = {j:i for i,j in character_map.items()}\n\nframes_infer = frames[:100]  # dynamic shape\nprint(f'inputs - shape: {frames_infer.shape} / dtype: {frames_infer.dtype}')\n🌟>>> inputs - shape: (100, 126) / dtype: float32\n\nprediction_fn = interpreter.get_signature_runner(\"serving_default\")\noutput = prediction_fn(inputs=frames_infer)\nprint(f'outputs - shape: {output[\"outputs\"].shape} / dtype: {output[\"outputs\"].dtype}')\n🌟>>> outputs - shape: (100, 59) / dtype: float32\n\nprediction_str = \"\".join([rev_character_map.get(s, \"\") for s in np.argmax(output['outputs'], axis=1)])\nprint(f'prediction: {prediction_str}')\n🌟>>> prediction:     9       5                                     3        33       -                               \ns\n``` \n\n**submission.zip**\n```bash\n!zip submission.zip inference_args.json test_model.tflite\n```\n\nIt appears that the TFLite model adheres to the input and output formats required in this competition.\nBut I continue to experience scoring errors, and I'm unable to identify the specific mistake I've made. \nI need help. \nThank you."
    },
    {
      "id": 2278962,
      "postDate": "2023-05-29T05:50:07.437Z",
      "rawMarkdown": "",
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 2351446,
      "author_name": "🍀<->🍀",
      "author_url": "",
      "post_date": "2023-07-20T06:38:10.887000",
      "content": "<p>Can you show me how to fix this bug???</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2278962,
      "author_name": "",
      "author_url": "",
      "post_date": "2023-05-29T05:50:07.437000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2351446": "Can you show me how to fix this bug???",
    "2278167": "hello, I hope everyone enjoys the game in this competition as well, following the previous ASLR competition.\nbut I'm not able to enjoy it.\n\n5 consecutive submission scoring errors...\n🆘 help me\n\nI'm currently trying to create a simple model using 1D convolution to see if it can be used for scoring.\n\n- input - only hands(x, y, z) / shape: (n_frames, 126) (126 = 21 * 2 * 3)\n- after preprocessing - shape: (n_frames, 42, 2) , use x, y\n- model: dense(=linear=fully-connected) - relu - conv - bn - relu - ... - conv\n\nThe model can be converted to the TFLite format and operates as follows.\n\n**data load - selected_columns json**\n```python\nimport json\n\nwith open('inference_args.json', 'r') as f:\n    load_cols_json = json.load(f)\n\nselected_columns = load_cols_json['selected_columns']\n🌟>>> ['x_left_hand_0', 'x_left_hand_1', 'x_left_hand_2', 'x_left_hand_3', 'x_left_hand_4', 'x_left_hand_5', 'x_left_hand_6', 'x_left_hand_7', 'x_left_hand_8', 'x_left_hand_9', 'x_left_hand_10', 'x_left_hand_11', 'x_left_hand_12', 'x_left_hand_13', 'x_left_hand_14', 'x_left_hand_15', 'x_left_hand_16', 'x_left_hand_17', 'x_left_hand_18', 'x_left_hand_19', 'x_left_hand_20', 'x_right_hand_0', 'x_right_hand_1', 'x_right_hand_2', 'x_right_hand_3', 'x_right_hand_4', 'x_right_hand_5', 'x_right_hand_6', 'x_right_hand_7', 'x_right_hand_8', 'x_right_hand_9', 'x_right_hand_10', 'x_right_hand_11', 'x_right_hand_12', 'x_right_hand_13', 'x_right_hand_14', 'x_right_hand_15', 'x_right_hand_16', 'x_right_hand_17', 'x_right_hand_18', 'x_right_hand_19', 'x_right_hand_20', 'y_left_hand_0', 'y_left_hand_1', 'y_left_hand_2', 'y_left_hand_3', 'y_left_hand_4', 'y_left_hand_5', 'y_left_hand_6', 'y_left_hand_7', 'y_left_hand_8', 'y_left_hand_9', 'y_left_hand_10', 'y_left_hand_11', 'y_left_hand_12', 'y_left_hand_13', 'y_left_hand_14', 'y_left_hand_15', 'y_left_hand_16', 'y_left_hand_17', 'y_left_hand_18', 'y_left_hand_19', 'y_left_hand_20', 'y_right_hand_0', 'y_right_hand_1', 'y_right_hand_2', 'y_right_hand_3', 'y_right_hand_4', 'y_right_hand_5', 'y_right_hand_6', 'y_right_hand_7', 'y_right_hand_8', 'y_right_hand_9', 'y_right_hand_10', 'y_right_hand_11', 'y_right_hand_12', 'y_right_hand_13', 'y_right_hand_14', 'y_right_hand_15', 'y_right_hand_16', 'y_right_hand_17', 'y_right_hand_18', 'y_right_hand_19', 'y_right_hand_20', 'z_left_hand_0', 'z_left_hand_1', 'z_left_hand_2', 'z_left_hand_3', 'z_left_hand_4', 'z_left_hand_5', 'z_left_hand_6', 'z_left_hand_7', 'z_left_hand_8', 'z_left_hand_9', 'z_left_hand_10', 'z_left_hand_11', 'z_left_hand_12', 'z_left_hand_13', 'z_left_hand_14', 'z_left_hand_15', 'z_left_hand_16', 'z_left_hand_17', 'z_left_hand_18', 'z_left_hand_19', 'z_left_hand_20', 'z_right_hand_0', 'z_right_hand_1', 'z_right_hand_2', 'z_right_hand_3', 'z_right_hand_4', 'z_right_hand_5', 'z_right_hand_6', 'z_right_hand_7', 'z_right_hand_8', 'z_right_hand_9', 'z_right_hand_10', 'z_right_hand_11', 'z_right_hand_12', 'z_right_hand_13', 'z_right_hand_14', 'z_right_hand_15', 'z_right_hand_16', 'z_right_hand_17', 'z_right_hand_18', 'z_right_hand_19', 'z_right_hand_20']\n```\n\n**data load - load parquet file**\n```python\ndef load_relevant_data_subset(pq_path):\n    return pd.read_parquet(pq_path, columns=selected_columns)\n\ndata_path = \"/jws/kaggle/input/asl-fingerspelling/train_landmarks/1019715464.parquet\"\nframes = load_relevant_data_subset(data_path).values\n\nprint(frames.shape, frames.dtype)\n🌟>>> (161722, 126) float32\n```\n\n\n**tflite inference**\n```python\nimport tflite_runtime.interpreter as tflite\ninterpreter = tflite.Interpreter(model_path)\n\nwith open (\"/jws/kaggle/input/asl-fingerspelling/character_to_prediction_index.json\", \"r\") as f:\n    character_map = json.load(f)\nrev_character_map = {j:i for i,j in character_map.items()}\n\nframes_infer = frames[:100]  # dynamic shape\nprint(f'inputs - shape: {frames_infer.shape} / dtype: {frames_infer.dtype}')\n🌟>>> inputs - shape: (100, 126) / dtype: float32\n\nprediction_fn = interpreter.get_signature_runner(\"serving_default\")\noutput = prediction_fn(inputs=frames_infer)\nprint(f'outputs - shape: {output[\"outputs\"].shape} / dtype: {output[\"outputs\"].dtype}')\n🌟>>> outputs - shape: (100, 59) / dtype: float32\n\nprediction_str = \"\".join([rev_character_map.get(s, \"\") for s in np.argmax(output['outputs'], axis=1)])\nprint(f'prediction: {prediction_str}')\n🌟>>> prediction:     9       5                                     3        33       -                               \ns\n``` \n\n**submission.zip**\n```bash\n!zip submission.zip inference_args.json test_model.tflite\n```\n\nIt appears that the TFLite model adheres to the input and output formats required in this competition.\nBut I continue to experience scoring errors, and I'm unable to identify the specific mistake I've made. \nI need help. \nThank you.",
    "2278962": ""
  }
}