fix(vision): use ARM Python venv for Metal GPU detection
The hardware detection was using system python3 which was x86_64 (Rosetta) instead of native ARM. This prevented TensorFlow from detecting the Metal GPU on Apple Silicon. Now uses a Python 3.11 venv with tensorflow-macos and tensorflow-metal for proper M4 Max GPU detection. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
efa35de92d
commit
57238d6f6e
|
|
@ -63,3 +63,4 @@ data/uploads/
|
|||
|
||||
# ML training data
|
||||
training-data/
|
||||
scripts/train-column-classifier/.venv/
|
||||
|
|
|
|||
|
|
@ -45,9 +45,16 @@ export async function GET(): Promise<Response> {
|
|||
let stderr = ''
|
||||
let hasError = false
|
||||
|
||||
const childProcess = spawn('python3', [scriptPath], {
|
||||
// Use the venv Python with tensorflow-metal for proper GPU detection
|
||||
const venvPython = path.join(cwd, 'scripts/train-column-classifier/.venv/bin/python')
|
||||
|
||||
const childProcess = spawn(venvPython, [scriptPath], {
|
||||
cwd,
|
||||
env: { ...process.env, PYTHONUNBUFFERED: '1' },
|
||||
env: {
|
||||
...process.env,
|
||||
PYTHONUNBUFFERED: '1',
|
||||
PYTHONWARNINGS: 'ignore::FutureWarning', // Suppress keras warning
|
||||
},
|
||||
})
|
||||
|
||||
childProcess.stdout?.on('data', (data: Buffer) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue