kapelianovych / ai Goto Github PK
View Code? Open in Web Editor NEWLibrary for creating AI with Dart
Home Page: https://pub.dev/packages/ai
License: Other
Library for creating AI with Dart
Home Page: https://pub.dev/packages/ai
License: Other
Running code from example got these errors:
➜ bin dart mlp_main.dart
../../../.pub-cache/hosted/pub.dartlang.org/ai-0.1.10/lib/src/network/cnn.dart:20:65: Error: Getter not found: 'RGB'.
imageRGB.toList().map((v) => v.toInt()).toList(), Image.RGB);
^^^
../../../.pub-cache/hosted/pub.dartlang.org/ai-0.1.10/lib/src/network/cnn.dart:19:37: Error: Too many positional arguments: 3 allowed, but 4 found.
Try removing the extra positional arguments.
final newImage = Image.fromBytes(originalImage.width, originalImage.height,
^
../../../.pub-cache/hosted/pub.dartlang.org/image-2.1.4/lib/src/image.dart:150:3: Context: Found this candidate, but the arguments don't match.
Image.fromBytes(int width, int height, List<int> bytes,
^^^^^^^^^
Trying to run the example located at https://github.com/YevhenKap/ai/blob/master/example/README.md returns in an error. I cannot file the structure file anywhere in the source tree.
Error: Error when reading 'bin/main.dart': The system cannot find the path specified.
StreamSink is closed and adding to it is an error.
See http://dartbug.com/29554.
#0 _StreamSinkImpl._reportClosedSink (dart:_http/http_impl.dart:537:31)
#1 _StreamSinkImpl.add (dart:_http/http_impl.dart:542:7)
#2 _WebSocketImpl.add (dart:_http/websocket_impl.dart:1203:11)
#3 WebSocketClient.post (dart:vmservice_io/server.dart:78:18)
#4 _RootZone.runUnary (dart:async/zone.dart:1379:54)
#5 _FutureListener.handleValue (dart:async/future_impl.dart:129:18)
#6 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:642:45)
#7 Future._propagateToListeners (dart:async/future_impl.dart:671:32)
#8 Future._complete (dart:async/future_impl.dart:476:7)
#9 _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
#10 _AsyncAwaitCompleter.complete (dart:async/runtime/libasync_patch.dart:28:18)
#11 _completeOnAsyncReturn (dart:async/runtime/libasync_patch.dart:295:13)
#12 VMService.routeRequest (dart:_vmservice)
#13 Client.onRequest (dart:_vmservice/client.dart:44:13)
#14 WebSocketClient.onWebSocketMessage (dart:vmservice_io/server.dart:52:13)
#15 new WebSocketClient. (dart:vmservice_io/server.dart:25:32)
#16 _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#17 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#18 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#19 _SyncStreamController._sendData (dart:async/stream_controller.dart:763:19)
#20 _StreamController._add (dart:async/stream_controller.dart:639:7)
#21 _StreamController.add (dart:async/stream_controller.dart:585:5)
#22 new _WebSocketImpl._fromSocket. (dart:_http/websocket_impl.dart:1128:21)
#23 _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#24 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#25 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#26 _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:68:11)
#27 _EventSinkWrapper.add (dart:async/stream_transformers.dart:15:11)
#28 _WebSocketProtocolTransformer._messageFrameEnd (dart:_http/websocket_impl.dart:334:22)
#29 _WebSocketProtocolTransformer.add (dart:_http/websocket_impl.dart:229:46)
#30 _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:120:24)
#31 _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#32 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#33 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#34 _SyncStreamController._sendData (dart:async/stream_controller.dart:763:19)
#35 _StreamController._add (dart:async/stream_controller.dart:639:7)
#36 _StreamController.add (dart:async/stream_controller.dart:585:5)
#37 _Socket._onData (dart:io/runtime/binsocket_patch.dart:1721:41)
#38 _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#39 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#40 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#41 _SyncStreamController._sendData (dart:async/stream_controller.dart:763:19)
#42 _StreamController._add (dart:async/stream_controller.dart:639:7)
#43 _StreamController.add (dart:async/stream_controller.dart:585:5)
#44 new _RawSocket. (dart:io/runtime/binsocket_patch.dart:1283:33)
#45 _NativeSocket.issueReadEvent.issue (dart:io/runtime/binsocket_patch.dart:826:14)
#46 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#47 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#48 _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:115:13)
#49 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:172:5)
StreamSink is closed and adding to it is an error.
See http://dartbug.com/29554.
#0 _StreamSinkImpl._reportClosedSink (dart:_http/http_impl.dart:537:31)
#1 _StreamSinkImpl.add (dart:_http/http_impl.dart:542:7)
#2 _WebSocketImpl.add (dart:_http/websocket_impl.dart:1203:11)
#3 WebSocketClient.post (dart:vmservice_io/server.dart:78:18)
#4 _RootZone.runUnary (dart:async/zone.dart:1379:54)
#5 _FutureListener.handleValue (dart:async/future_impl.dart:129:18)
#6 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:642:45)
#7 Future._propagateToListeners (dart:async/future_impl.dart:671:32)
#8 Future._complete (dart:async/future_impl.dart:476:7)
#9 _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
#10 _AsyncAwaitCompleter.complete (dart:async/runtime/libasync_patch.dart:28:18)
#11 _completeOnAsyncReturn (dart:async/runtime/libasync_patch.dart:295:13)
#12 VMService.routeRequest (dart:_vmservice)
#13 Client.onRequest (dart:_vmservice/client.dart:44:13)
#14 WebSocketClient.onWebSocketMessage (dart:vmservice_io/server.dart:52:13)
#15 new WebSocketClient. (dart:vmservice_io/server.dart:25:32)
#16 _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#17 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#18 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#19 _SyncStreamController._sendData (dart:async/stream_controller.dart:763:19)
#20 _StreamController._add (dart:async/stream_controller.dart:639:7)
#21 _StreamController.add (dart:async/stream_controller.dart:585:5)
#22 new _WebSocketImpl._fromSocket. (dart:_http/websocket_impl.dart:1128:21)
#23 _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#24 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#25 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#26 _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:68:11)
#27 _EventSinkWrapper.add (dart:async/stream_transformers.dart:15:11)
#28 _WebSocketProtocolTransformer._messageFrameEnd (dart:_http/websocket_impl.dart:334:22)
#29 _WebSocketProtocolTransformer.add (dart:_http/websocket_impl.dart:229:46)
#30 _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:120:24)
#31 _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#32 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#33 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#34 _SyncStreamController._sendData (dart:async/stream_controller.dart:763:19)
#35 _StreamController._add (dart:async/stream_controller.dart:639:7)
#36 _StreamController.add (dart:async/stream_controller.dart:585:5)
#37 _Socket._onData (dart:io/runtime/binsocket_patch.dart:1721:41)
#38 _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#39 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#40 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#41 _SyncStreamController._sendData (dart:async/stream_controller.dart:763:19)
#42 _StreamController._add (dart:async/stream_controller.dart:639:7)
#43 _StreamController.add (dart:async/stream_controller.dart:585:5)
#44 new _RawSocket. (dart:io/runtime/binsocket_patch.dart:1283:33)
#45 _NativeSocket.issueReadEvent.issue (dart:io/runtime/binsocket_patch.dart:826:14)
#46 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#47 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#48 _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:115:13)
#49 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:172:5)
StreamSink is closed and adding to it is an error.
See http://dartbug.com/29554.
#0 _StreamSinkImpl._reportClosedSink (dart:_http/http_impl.dart:537:31)
#1 _StreamSinkImpl.add (dart:_http/http_impl.dart:542:7)
#2 _WebSocketImpl.add (dart:_http/websocket_impl.dart:1203:11)
#3 WebSocketClient.post (dart:vmservice_io/server.dart:78:18)
#4 _RootZone.runUnary (dart:async/zone.dart:1379:54)
#5 _FutureListener.handleValue (dart:async/future_impl.dart:129:18)
#6 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:642:45)
#7 Future._propagateToListeners (dart:async/future_impl.dart:671:32)
#8 Future._complete (dart:async/future_impl.dart:476:7)
#9 _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
#10 _AsyncAwaitCompleter.complete (dart:async/runtime/libasync_patch.dart:28:18)
#11 _completeOnAsyncReturn (dart:async/runtime/libasync_patch.dart:295:13)
#12 VMService.routeRequest (dart:_vmservice)
#13 Client.onRequest (dart:_vmservice/client.dart:44:13)
#14 WebSocketClient.onWebSocketMessage (dart:vmservice_io/server.dart:52:13)
#15 new WebSocketClient. (dart:vmservice_io/server.dart:25:32)
#16 _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#17 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#18 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#19 _SyncStreamController._sendData (dart:async/stream_controller.dart:763:19)
#20 _StreamController._add (dart:async/stream_controller.dart:639:7)
#21 _StreamController.add (dart:async/stream_controller.dart:585:5)
#22 new _WebSocketImpl._fromSocket. (dart:_http/websocket_impl.dart:1128:21)
#23 _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#24 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#25 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#26 _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:68:11)
#27 _EventSinkWrapper.add (dart:async/stream_transformers.dart:15:11)
#28 _WebSocketProtocolTransformer._messageFrameEnd (dart:_http/websocket_impl.dart:334:22)
#29 _WebSocketProtocolTransformer.add (dart:_http/websocket_impl.dart:229:46)
#30 _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:120:24)
#31 _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#32 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#33 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#34 _SyncStreamController._sendData (dart:async/stream_controller.dart:763:19)
#35 _StreamController._add (dart:async/stream_controller.dart:639:7)
#36 _StreamController.add (dart:async/stream_controller.dart:585:5)
#37 _Socket._onData (dart:io/runtime/binsocket_patch.dart:1721:41)
#38 _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#39 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#40 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#41 _SyncStreamController._sendData (dart:async/stream_controller.dart:763:19)
#42 _StreamController._add (dart:async/stream_controller.dart:639:7)
#43 _StreamController.add (dart:async/stream_controller.dart:585:5)
#44 new _RawSocket. (dart:io/runtime/binsocket_patch.dart:1283:33)
#45 _NativeSocket.issueReadEvent.issue (dart:io/runtime/binsocket_patch.dart:826:14)
#46 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#47 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#48 _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:115:13)
#49 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:172:5)
StreamSink is closed and adding to it is an error.
See http://dartbug.com/29554.
#0 _StreamSinkImpl._reportClosedSink (dart:_http/http_impl.dart:537:31)
#1 _StreamSinkImpl.add (dart:_http/http_impl.dart:542:7)
#2 _WebSocketImpl.addUtf8Text (dart:_http/websocket_impl.dart:1210:11)
#3 WebSocketClient.post (dart:vmservice_io/server.dart:81:18)
#4 _RootZone.runUnary (dart:async/zone.dart:1379:54)
#5 _FutureListener.handleValue (dart:async/future_impl.dart:129:18)
#6 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:642:45)
#7 Future._propagateToListeners (dart:async/future_impl.dart:671:32)
#8 Future._complete (dart:async/future_impl.dart:476:7)
#9 _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
#10 _AsyncAwaitCompleter.complete (dart:async/runtime/libasync_patch.dart:28:18)
#11 _completeOnAsyncReturn (dart:async/runtime/libasync_patch.dart:295:13)
#12 VMService.routeRequest (dart:_vmservice)
#13 Client.onRequest (dart:_vmservice/client.dart:44:13)
#14 WebSocketClient.onWebSocketMessage (dart:vmservice_io/server.dart:52:13)
#15 new WebSocketClient. (dart:vmservice_io/server.dart:25:32)
#16 _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#17 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#18 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#19 _SyncStreamController._sendData (dart:async/stream_controller.dart:763:19)
#20 _StreamController._add (dart:async/stream_controller.dart:639:7)
#21 _StreamController.add (dart:async/stream_controller.dart:585:5)
#22 new _WebSocketImpl._fromSocket. (dart:_http/websocket_impl.dart:1128:21)
#23 _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#24 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#25 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#26 _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:68:11)
#27 _EventSinkWrapper.add (dart:async/stream_transformers.dart:15:11)
#28 _WebSocketProtocolTransformer._messageFrameEnd (dart:_http/websocket_impl.dart:334:22)
#29 _WebSocketProtocolTransformer.add (dart:_http/websocket_impl.dart:229:46)
#30 _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:120:24)
#31 _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#32 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#33 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#34 _SyncStreamController._sendData (dart:async/stream_controller.dart:763:19)
#35 _StreamController._add (dart:async/stream_controller.dart:639:7)
#36 _StreamController.add (dart:async/stream_controller.dart:585:5)
#37 _Socket._onData (dart:io/runtime/binsocket_patch.dart:1721:41)
#38 _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#39 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#40 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#41 _SyncStreamController._sendData (dart:async/stream_controller.dart:763:19)
#42 _StreamController._add (dart:async/stream_controller.dart:639:7)
#43 _StreamController.add (dart:async/stream_controller.dart:585:5)
#44 new _RawSocket. (dart:io/runtime/binsocket_patch.dart:1283:33)
#45 _NativeSocket.issueReadEvent.issue (dart:io/runtime/binsocket_patch.dart:826:14)
#46 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#47 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#48 _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:115:13)
#49 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:172:5)
Exited (254)
Here's the output when I run the ai_test.dart
file:
Error - 0.6425
… (lot of lines with this same output)
Error - 0.6425
Recognize 5? - [0.6704479923682499]
Recognize distorted 5? - 0.6692284352978769
Recognize distorted 5? - 0.66563947780293
Recognize distorted 5? - 0.6683650961682964
Recognize distorted 5? - 0.6705769038157806
Recognize distorted 5? - 0.677611805859227
Recognize distorted 5? - 0.6650073782758098
Аnd 0? - [0.6734468198670922]
Аnd 8? - [0.6792055553133528]
Аnd 3? - [0.6803797164665454]
This is the compiler output:
The current Dart SDK version is 2.1.0-dev.9.4.flutter-f9ebf21297.
Because untitled1 depends on ai >=0.1.2 which requires SDK version >=2.1.0 <3.0.0, version solving failed.
pub get failed (1)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.