th3-j0k3r commited on
Commit
a04c981
·
verified ·
1 Parent(s): 26f5357

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +14 -7
README.md CHANGED
@@ -14,18 +14,25 @@ nested Lambda — but Keras deserializes sub-models recursively and executes it
14
  - `README.md` — this file
15
 
16
  ## Reproduce
17
- > Use **Python 3.10+** (verified on Python 3.12 / TensorFlow 2.21 / Keras 3.14 / modelscan 0.8.8).
18
- > TensorFlow on the EOL Python 3.9 can abort at import on macOS arm64 (`mutex lock failed`),
19
- > which is unrelated to this issue. The clean venv below avoids it.
20
 
21
  ```bash
22
- # Clean Python 3.10+ environment (so `python` is correct, not a system 3.9)
23
- python3.12 -m venv venv && source venv/bin/activate
 
 
 
 
 
 
 
24
  pip install 'modelscan[tensorflow]' tensorflow keras
25
 
26
- # 1) scanner says it is safe:
27
  modelscan -p model.keras # -> No issues found
28
- # 2) loading it executes code:
29
  python -c "import keras; keras.saving.load_model('model.keras', safe_mode=False, compile=False)"
30
  ls keras_poc_executed.txt # marker proves code ran on load
31
  # or run the full demo (flat=detected, nested=bypass):
 
14
  - `README.md` — this file
15
 
16
  ## Reproduce
17
+ Use **Python 3.10+** (verified on 3.12 / TensorFlow 2.21 / Keras 3.14 / modelscan 0.8.8).
18
+ TensorFlow does not run on the EOL Python 3.9 on macOS arm64 it aborts at import with
19
+ `mutex lock failed`, which is unrelated to this issue.
20
 
21
  ```bash
22
+ # 0) Get Python 3.10+ if needed:
23
+ # macOS: brew install python@3.12
24
+ # Debian/Ubuntu: sudo apt-get install -y python3.12 python3.12-venv
25
+ python3.12 --version # -> Python 3.12.x
26
+
27
+ # 1) Clean virtual environment so `python` is 3.12, not the system 3.9
28
+ python3.12 -m venv venv
29
+ source venv/bin/activate # Windows: venv\Scripts\activate
30
+ python --version # -> Python 3.12.x
31
  pip install 'modelscan[tensorflow]' tensorflow keras
32
 
33
+ # 2) Scanner says it is safe:
34
  modelscan -p model.keras # -> No issues found
35
+ # 3) Loading it executes code:
36
  python -c "import keras; keras.saving.load_model('model.keras', safe_mode=False, compile=False)"
37
  ls keras_poc_executed.txt # marker proves code ran on load
38
  # or run the full demo (flat=detected, nested=bypass):