tfjs: ES6 Module Import of Tensorflow no longer works
To get help from the community, we encourage using Stack Overflow and the tensorflow.js
tag.
TensorFlow.js version
Tensorflow Core 2.1.0
Browser version
Doesn’t matter, but Chrome 85
Describe the problem or feature request
Previously, with Tensorflow (ex 1.3.2), I could use ES6 module imports along with a simple bare-module resolving server like es-dev-server (https://www.npmjs.com/package/es-dev-server), or quite possibly the Chrome only import maps.
Unfortunately, now, that’s not possible. It looks like the newer dependency tfjs-backend-cpu
contains a seedrandom
import, and this module is not a proper ES6 import (uses require() for importing). Perhaps this small module could be bundled as an ES6 import prior to shipping such that it all works again?
thanks!
About this issue
- Original URL
- State: open
- Created 4 years ago
- Comments: 16 (7 by maintainers)
Commits related to this issue
- Use a more simple type construction for IOHandlerSync There's likely a breaking change from ts3.5.3 to ts4.x that causes the Syncify type to work correctly in ts3.5.3 but fail in ts4.x. Until we swit... — committed to mattsoulanille/tfjs by mattsoulanille 2 years ago
- Use a more simple type construction for IOHandlerSync (#6481) There's likely a breaking change from ts3.5.3 to ts4.x that causes the Syncify type to work correctly in ts3.5.3 but fail in ts4.x. Until... — committed to tensorflow/tfjs by mattsoulanille 2 years ago
This is still an issue.
Using Angular (webpack), it is possible to import, but the following message is given:
tfjs 3.16.0