im trying to mess with nural networks and i decided to use ml5, everything is great except i cant get the model to predict without it making an error.
ive tried putting the prediction inside an async function ad resolving its promise but it didnt help at all, tried messing with the inputs, still nothing changes
the eror in question:
TypeError: Cannot read properties of undefined (reading 'undefined')
at isOneHotEncodedOrNormalized (webpack://ml5/src/NeuralNetwork/index.js:449:33)
at this.isOneHotEncodedOrNormalized (webpack://ml5/src/NeuralNetwork/index.js:401:20)
at this.isOneHotEncodedOrNormalized (webpack://ml5/src/NeuralNetwork/index.js:400:31)
at _input.every (webpack://ml5/src/NeuralNetwork/index.js:432:18)
at predictInternal (webpack://ml5/src/NeuralNetwork/index.js:923:27)
at tryCatch (webpack://ml5/node_modules/#babel/runtime/node_modules/regenerator-runtime/runtime.js:63:14)
at context.dispatchException (webpack://ml5/node_modules/#babel/runtime/node_modules/regenerator-runtime/runtime.js)
at define (webpack://ml5/node_modules/#babel/runtime/node_modules/regenerator-runtime/runtime.js)
at asyncGeneratorStep (webpack://ml5/node_modules/#babel/runtime/helpers/asyncToGenerator.js)
im using https://unpkg.com/ml5#latest/dist/ml5.min.js if this helps, i dont know if the error was caused by my code or the ml5 code or what
Related
Hi I'm trying to create an html script tag within a react component and incorporate google ads but getting this
error (index):74 Uncaught TypeError: Cannot set property 'cmd' of
undefined
.
I'm very new to react so this might be a simple fix but not sure what I'm doing wrong. Here is a snapshot of my component GoogleAdUnit code.
GoogleAdUnit Component Code
If you need anymore information please let me know and I can provide it. Thanks in advance!
You are using "googletag" even though you never defined it before, thus it is undefined and you can't use googletag.cmd.
I am running into an issue trying to implement the PDF.js viewer demo found here, but I keep running into an issue that certain properties are not being set. Checking the console there are two errors that I get:
First error:
app.js:883 Uncaught (in promise) TypeError: Cannot read property 'setPagesCount' of null
at Object.load (app.js:883)
at app.js:666
Second error:
app.js:870 Uncaught (in promise) TypeError: Cannot read property 'then' of undefined
at app.js:870
I have tried resolving this issue by diving through the code myself, and comparing it to the example with no luck. I have also looked around online trying to figure out why this may be happening and have still come up empty handed. It seems to me that this.toolbar is not being set with anything in the first error, but I cannot figure out why this may be.
Through looking around online, I believe I am setting this up properly, but am not 100% positive. Here is my setup:
<script type="text/javascript">
$(document).ready(function () {
var pdfDoc = '#pdf';
// Open the default file after the document is ready. Otherwise, PDFViewerApplication probably won't exist.
PDFViewerApplication.open(pdfDoc);
});
</script>
Has anyone ever experienced this before and would be able to help? If not, does anyone know where I can start to look?
An additional note is that I have moved the files outside of their original build and web directories. I thought that I changed the configuration paths in viewer.js to accommodate this, but perhaps I missed one?
It appears that my issue was do to me not adding the link resource for locale.properties in my HTML. Turns out the first error I was getting was more of a red herring, and was able to solve this issue by focusing on the second error.
I added this:
<link rel="resource" type="application/l10n" href="[your path to]/locale/locale.properties">
Where all the HTML for the viewer is located and it loaded right up.
I'm getting an error message in a fairly complex app, but Angular does not provide a filename or line number indicating where the error was thrown initially. I have gotten used to this with Angular and I've been able to find the cause of errors nonetheless in the past, but not this time. This is the error:
Error: [$injector:strictdi] http://errors.angularjs.org/1.6.1/$injector/strictdi?p0=function(%24compile)
at angular.js:38
at Function.eb.$$annotate (angular.js:4072)
at e (angular.js:4799)
at Object.invoke (angular.js:4834)
at angular.js:7943
at q (angular.js:357)
at Object.<anonymous> (angular.js:7941)
at Object.invoke (angular.js:4842)
at Object.$get (angular.js:4676)
at Object.invoke (angular.js:4842)
We're using $compile in a lot of different places in our app, including a number of third party directives/modules. My question is: is there any way to find the piece of code that's causing this error? I have been searching for '$compile' in my source code, but that gives me so many results that it doesn't really help.
Is there any way to enable better stack traces including my own source, not just AngularJS functions? If this does not exist, I'd like to know it too and I'll have to find another way to fix this, but I hope I'm not missing something here.
I have encountered an unfortunate bug when attempting to run my bot written in Node.js.
Whenever attempting to run the init script which calls various other functions of the bot, I am given the following error of "TypeError: Cannot read property 'Symbol(Symbol.toStringTag)' of undefined" at various different points in my code. I understand that this is one of the standard functions from JavaScript, so I am unsure why it is giving me an error.
The odd part is these errors are new, and I have run the scripts before many times without running into this issue.
Below is the first error line in async.js which shows at line 175.
174 function isAsync(fn) {
175 return supportsSymbol && fn[Symbol.toStringTag] === 'AsyncFunction';
176 }
And a second example is in my own bot_startup.js at line 43.
43 connectToServerCallback(null, "connected");
It seems like it is erroring out whenever trying to convert data to strings, but I do not know how I would go about fixing this. Any help would be appreciated.
For those wondering, I was able to fix this problem on my own.
The error itself arose from one of the functions being called in async.waterfall not being correctly defined (an error in committing to Git rolled back one of the files it was calling functions from, making the function call no longer valid).
trying to fiddle with an app, getting this error "Uncaught TypeError: Cannot read property '1' of undefined "in dev tools console. i'm pretty sure it's because of the json i'm pulling and the proxy i'm using are not talking to each other correctly. seriously n00b question, i truly don't understand what's going on in the document. i also see that there are ALOT of similar questions like this, so i'm guessing they're pretty localized and not great for the community. still important to me though...i'd like to learn what's going on in the code, not just fix the problem. you can check it out here: http://dev.bowdenweb.com/busfinder.html i did put it up on jsfiddle, but it wasn't rendering correctly. thanks for any and all advice!
loadBusesIntoMap seems to be the root of the problem. On Chrome developer tools, click on the arrow next to the error and track the stack. Just before running Google maps code the function that throws error is that one. It's very probable that somewhere you're sending an empty buses array. I'd start by checking if it's empty or has a length first...