Orillusion

    • 注册
    • 登录
    • 搜索
    • 版块
    • 最新
    • 标签

    使用TensorFlow.js调用WebGPU时出现的问题

    General Discussion
    webgpu macos tensorflow.js
    2
    2
    144
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • S
      stayreal1994 最后由 编辑

      问题背景

      各位大佬,我目前在尝试使用TensorFlow.js在浏览器上实现神经网络的inference。希望使用TensorFlow.js调用其实现的WebGPU backend来使用WebGPU做神经网络的inference。

      问题复现

      软件

      我使用TensorFlow.js的官方MobileNet example (源码) 来尝试。
      由于原版的example没有使用WebGPU backend,因此我将其index.js的前几句改为

      import * as tf from '@tensorflow/tfjs';
      
      import '@tensorflow/tfjs-backend-webgpu'
      
      import { IMAGENET_CLASSES } from './imagenet_classes';
      
      tf.setBackend('webgpu');
      

      硬件

      MacBook Pro M1 Max (with built-in GPU) + Google Chrome Canary (106.0.5205.0)

      问题

      我本地使用npm构建并本地serve来运行上述案例。
      正常的运行没有问题,但是在命令行中有如下提示:

      This device doesn't support timestamp-query extension. Start Chrome browser with flag --disable-dawn-features=disallow_unsafe_apis then try again. Or zero will shown for the kernel time when profiling mode isenabled. Using performance.now is not workable for webgpu since it doesn't support synchronously to read data from GPU.

      即使我按照其说明的,在启动Google Chrome Canary时使用

      ./Google Chrome Canary --args --disable-dawn-features=disallow_unsafe_apis
      

      来启动,仍然会有如上提示。请问大家是否能够遇到同样的问题?是否有解决的方法?

      shuangliu 1 条回复 最后回复 回复 引用 1
      • shuangliu
        shuangliu @stayreal1994 最后由 shuangliu 编辑

        @stayreal1994

        1. 这个问题,可以去 tf.js github 的 issue 里提

        2. 据我们所知,tf.js 正在进行基于 webgpu 的 backend 的开发,因为 webgpu 完全异步的架构,基本上是重构了整个 tf.js,大概率会有很多 API 或 用法上的区别,所以肯定不是简单 setBackEnd('webgpu') 就可以解决的,最好等他们发布官方版本后再尝试

        另外,确实 WebGPU API 本身变化很大,好多功能还没有支持,像 timestamp-query 我不确定 chrome 是否加入了,目前应该是没有支持,即使加了参数也不行

        1 条回复 最后回复 回复 引用 0
        • First post
          Last post

        Recent Post

        • H

          您是打算上C++来测试WebGPU吗?

          • 阅读更多
        • F

          @shuangliu 谢谢大佬指点,已经能clone下来了😇

          • 阅读更多
        • 首先,只设置 http.proxy 就行

          其次,请明确本地socks5的端口,不是所有的梯子都用1080/1086/443,每个软件都不一样,不要只是搜了网上的例子就粘过来用,比如,我用的 clash 一般是使用 7890 端口

          git config --global http.proxy 'socks5://127.0.0.1:7890'

          刚测试过,可以 clone Dawn 的 repo

          • 阅读更多
        • F

          @shuangliu 我使用如下设置

          git config --global http.proxy http://127.0.0.1:1080 git config --global http.proxy 'socks5://127.0.0.1:1080' git config --global https.proxy socks5://1270.0.1:1086 git config --global https.proxy socks5://1270.0.1:1080 git config --global https.proxy http://127.0.0.1:443

          都clone不下来

          • 阅读更多
        • @FuXii 目前一般的梯子,都是本地的socks5代理,是无法直接代理terminal,git,ssh 这些程序的,需要特殊的配置才可以,先自行搜索一下 git 的代理设置
          或者使用 Proxifier 类似的软件,直接转发系统底层tcp/udp 的连接到 socks5 代理

          • 阅读更多

        Copyright © 2022 Orillusion | Contact US