Could not get context for WebGL version 2

import * as tf from '@tensorflow/tfjs';

 

几乎所有的博文都只是照搬原文,但是原文只引入了上文,应该添加下文

import '@tensorflow/tfjs-backend-webgl';
import '@tensorflow/tfjs-core/dist/public/chained_ops/sum'; // add the 'sum' chained op to all tensors

另外在

https://developer.aliyun.com/article/700350

https://www.w3cschool.cn/tensorflowjs/tensorflowjs-uc9p2q2m.html

这两个案例中,注意其中的const首字母大写了

 

新版tensorflowjs中有所变动,详见

https://tensorflow.google.cn/js/tutorials/upgrading_to_3_0

相关文章:

  • 2021-07-29
  • 2021-12-02
  • 2021-05-13
  • 2022-12-23
  • 2022-12-23
  • 2021-04-24
  • 2021-04-18
猜你喜欢
  • 2022-12-23
  • 2021-04-02
  • 2022-12-23
  • 2021-08-22
  • 2021-11-25
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案