[PR #1609] [MERGED] fix(kits): fix TFLite size typo and broken pth command in raspi image-classification lab #9220

Closed
opened 2026-05-03 01:29:15 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/harvard-edge/cs249r_book/pull/1609
Author: @Shashank-Tripathi-07
Created: 4/30/2026
Status: Merged
Merged: 4/30/2026
Merged by: @profvjreddi

Base: devHead: fix/kits-cifar10-tflite-size-typo


📝 Commits (1)

  • 6e26011 fix(kits): fix TFLite size typo and broken pth command in raspi image-classification lab

📊 Changes

1 file changed (+2 additions, -3 deletions)

View changed files

📝 kits/contents/raspi/image_classification/image_classification.qmd (+2 -3)

📄 Description

Summary

Two bugs in kits/contents/raspi/image_classification/image_classification.qmd:

Bug 1 -- Wrong size unit for cifar10.tflite (674MB → 674KB)

The text described the quantized TFLite model as 674MB -- but the original .keras model is only 2.0MB, and "around 1/3 of the original size" is ~674KB. 674MB would be 337x larger than the source model and bigger than the entire ImageNet training set, which is physically impossible for a CIFAR-10 classifier.

-The CNN trained model had a size of 2.0MB. Using TFLite Converter, cifar10.tflite became with 674MB (around 1/3 of the original size).
+The CNN trained model had a size of 2.0MB. Using TFLite Converter, cifar10.tflite became with 674KB (around 1/3 of the original size).

Bug 2 -- Broken bash command for picamera2 venv setup

The redirect target path was split across two lines with a stray newline inside the path, producing two invalid shell commands when copy-pasted:

# Before (broken -- newline splits the path)
echo "/usr/lib/python3/dist-packages" > \
 $VIRTUAL_ENV/lib/python3.11/
site-packages/system_site_packages.pth

# After (fixed -- path on one continuation line)
echo "/usr/lib/python3/dist-packages" > \
  $VIRTUAL_ENV/lib/python3.11/site-packages/system_site_packages.pth

The broken form would: (1) redirect stdout into a directory -- shell error, and (2) try to execute site-packages/system_site_packages.pth as a command -- another error. Students following the lab would get confusing errors and be unable to use picamera2 inside the venv.

Test plan

  • Verify the cifar10 size description reads "674KB" and makes sense in context (2.0MB → ~674KB after INT8 quantization)
  • Copy-paste the fixed pth command into a terminal and confirm it creates the .pth file correctly

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/harvard-edge/cs249r_book/pull/1609 **Author:** [@Shashank-Tripathi-07](https://github.com/Shashank-Tripathi-07) **Created:** 4/30/2026 **Status:** ✅ Merged **Merged:** 4/30/2026 **Merged by:** [@profvjreddi](https://github.com/profvjreddi) **Base:** `dev` ← **Head:** `fix/kits-cifar10-tflite-size-typo` --- ### 📝 Commits (1) - [`6e26011`](https://github.com/harvard-edge/cs249r_book/commit/6e26011f33af089ed4cd08b52cba038edc72d77d) fix(kits): fix TFLite size typo and broken pth command in raspi image-classification lab ### 📊 Changes **1 file changed** (+2 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `kits/contents/raspi/image_classification/image_classification.qmd` (+2 -3) </details> ### 📄 Description ## Summary Two bugs in `kits/contents/raspi/image_classification/image_classification.qmd`: ### Bug 1 -- Wrong size unit for cifar10.tflite (674MB → 674KB) The text described the quantized TFLite model as **674MB** -- but the original `.keras` model is only 2.0MB, and "around 1/3 of the original size" is ~**674KB**. 674MB would be 337x larger than the source model and bigger than the entire ImageNet training set, which is physically impossible for a CIFAR-10 classifier. ```diff -The CNN trained model had a size of 2.0MB. Using TFLite Converter, cifar10.tflite became with 674MB (around 1/3 of the original size). +The CNN trained model had a size of 2.0MB. Using TFLite Converter, cifar10.tflite became with 674KB (around 1/3 of the original size). ``` ### Bug 2 -- Broken bash command for picamera2 venv setup The redirect target path was split across two lines with a stray newline inside the path, producing two invalid shell commands when copy-pasted: ```bash # Before (broken -- newline splits the path) echo "/usr/lib/python3/dist-packages" > \ $VIRTUAL_ENV/lib/python3.11/ site-packages/system_site_packages.pth # After (fixed -- path on one continuation line) echo "/usr/lib/python3/dist-packages" > \ $VIRTUAL_ENV/lib/python3.11/site-packages/system_site_packages.pth ``` The broken form would: (1) redirect stdout into a directory -- shell error, and (2) try to execute `site-packages/system_site_packages.pth` as a command -- another error. Students following the lab would get confusing errors and be unable to use picamera2 inside the venv. ## Test plan - [ ] Verify the cifar10 size description reads "674KB" and makes sense in context (2.0MB → ~674KB after INT8 quantization) - [ ] Copy-paste the fixed pth command into a terminal and confirm it creates the `.pth` file correctly --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-03 01:29:15 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/cs249r_book#9220