我已通过以下方式将模型导出到 ONNX:
# Export the model
torch_out = torch.onnx._export(learn.model, # model being run
x, # model input (or a tuple for multiple inputs)
EXPORT_PATH + "mnist.onnx", # where to save the model (can be a file or file-like object)
export_params=True) # store the trained parameter weights inside the model file
Run Code Online (Sandbox Code Playgroud)
现在我正在尝试将模型转换为 Tensorflow Lite 文件,以便我可以在 Android 上进行推理。不幸的是,PyTorch/Caffe2 对 Android 的支持相当缺乏或过于复杂,但 Tensorflow 看起来要简单得多。
ONNX 到 Tflite 的文档对此非常清楚。
我尝试通过以下方式导出到 Tensorflow GraphDef proto:
tf_rep.export_graph(EXPORT_PATH + 'mnist-test/mnist-tf-export.pb')
然后运行toco:
toco \
--graph_def_file=mnist-tf-export.pb \
--input_format=TENSORFLOW_GRAPHDEF …Run Code Online (Sandbox Code Playgroud) 我的目标是让用户登录主要使用 NodeJS 制作的桌面应用程序
目前,Firebase 似乎依赖于某种 cookie。有没有办法让用户无需电子邮件/密码即可再次登录?
我目前正在尝试使用 Firebase 身份验证作为我的 Electron 应用程序的一部分,其中我无法让 Firebase 身份验证代码成为通常可以访问浏览器级存储的渲染器进程的一部分。
理想的情况是这样的:
const auth_token = await user.getIdToken();
firebase
.auth()
.signInWithCustomToken(auth_token) // But maybe some other method?
.then((user) => {
console.log(user);
})
Run Code Online (Sandbox Code Playgroud)
在无法访问浏览器存储的 NodeJS 应用程序中,您将如何执行此操作,以便用户不需要持续登录?
引用此问题:Persist Firebase user for Node.js client application
fwiw,我不想与其他应用程序共享这些令牌。
一个稍微不同的问题:Electron 中的主进程可以存储 Firebase 可以访问的 cookie 吗?
最近读过这个:https://github.com/firebase/firebase-js-sdk/issues/292
我正在使用 Electron 8.0.3,我正在尝试播放自定义声音。这就是我正在做的:
const notif = new Notification({
title: 'Finished Download',
body: 'test',
sound: 'vapp/assets/sounds/mighty_sound.mp3',
});
notif.show();
Run Code Online (Sandbox Code Playgroud)
它似乎没有播放该声音,而是播放默认的 macOS 声音。我试过了:
'/Users/<name>/Desktop/workspace/proj/vapp/assets/sounds/sound.mp3'/System/Library/Sounds无论出于何种原因,它都会播放相同的声音。
我已经参考了这个文档