# garbage-classify **Repository Path**: xdhuxc/garbage-classify ## Basic Information - **Project Name**: garbage-classify - **Description**: garbage classify - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2021-08-01 - **Last Updated**: 2021-08-01 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### garbage classify 生成 package.json 文件 ``` npm init -y ``` #### 运行 1、运行程序 ``` node train ``` ### 安装 tensorflow 1、使用如下命令安装 tensorflow ``` npm --registry https://registry.npm.taobao.org install @tensorflow/tfjs-node 或 yarn add @tensorflow/tfjs-node ``` 报错如下: ``` yp: No Xcode or CLT version detected! gyp ERR! configure error gyp ERR! stack Error: `gyp` failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16) gyp ERR! stack at ChildProcess.emit (events.js:182:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12) gyp ERR! System Darwin 20.5.0 gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/private/var/root/node_modules/@tensorflow/tfjs-node/lib/napi-v3/tfjs_binding.node" "--module_name=tfjs_binding" "--module_path=/private/var/root/node_modules/@tensorflow/tfjs-node/lib/napi-v3" "--napi_version=3" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3" gyp ERR! cwd /private/var/root/node_modules/@tensorflow/tfjs-node gyp ERR! node -v v10.14.2 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok ``` xcode 实际上是安装了的。操作如下: 1、查看 command-line tools 的安装路径: ``` xcode-select --print-path ``` 2、把 command-line tools 从系统移除掉 ``` sudo rm -r -f /Library/Developer/CommandLineTools ``` 3、重新安装 ``` xcode-select --install ```