liquidcarrot / carrot

🥕 Evolutionary Neural Networks in JavaScript
https://liquidcarrot.io/carrot/
MIT License
293 stars 34 forks source link

network evolve error: ReferenceError: regeneratorRuntime is not defined #244

Open tracycollins opened 3 years ago

tracycollins commented 3 years ago

Description

After updating to the latest version, network evolve crashes with this error:

Trace: ReferenceError: regeneratorRuntime is not defined at X.n.evolve (/Volumes/RAID1/projects/twitterNeuralNetwork/node_modules/@liquid-carrot/carrot/dist/index.min.js:1:138618)

To Reproduce

I have not yet put together an example to show this bug, but can if you need The evolve params were:

cost: MSE, efficientMutation: true, elitism: 2, equal: true, error: 0.05, fitnessPopulation: true, growth: 0.000058676602433414615, iterations: 10, mutation: [ { name: 'ADD_NODE' }, { name: 'SUB_NODE', keep_gates: true }, { name: 'ADD_CONN' }, { name: 'REMOVE_CONN' }, { name: 'MOD_WEIGHT', min: -1, max: 1 }, { name: 'MOD_BIAS', min: -1, max: 1 }, { name: 'MOD_ACTIVATION', mutateOutput: true, allowed: [Array] }, { name: 'SWAP_NODES', mutateOutput: true } ], mutationAmount: 1, mutationRate: 0.6947879778477388, network: null, popsize: 20, populationSize: 20, provenance: 0, schedule: { function: [Function: function], iterations: 1 }, selection: { name: 'FITNESS_PROPORTIONATE' }, threads: 4, population_size: 20, mutation_rate: 0.6947879778477388, mutation_amount: 1, fitness_population: true, max_nodes: undefined

Tasks

tracycollins commented 3 years ago

Update: version 0.3.18 works

christianechevarria commented 3 years ago

Okay excellent, should we close this issue?

tracycollins commented 3 years ago

Okay excellent, should we close this issue?

No

Sorry, my update wasn't clear:

v0.3.18 works v0.3.19 does not work

raimannma commented 3 years ago

I think that's a bug with parcel bundler or webpack.

Caused by some wrong settings at building the compact files. I am going to search a fix.

raimannma commented 3 years ago

Also @christianechevarria @luiscarbonell we should implement a CI test that checks the build javascript files.

raimannma commented 3 years ago

@tracycollins can you check if it works on this branch? https://github.com/liquidcarrot/carrot/tree/FIX_244_regenerator_runtime_error

tracycollins commented 3 years ago

@tracycollins can you check if it works on this branch? https://github.com/liquidcarrot/carrot/tree/FIX_244_regenerator_runtime_error

no, didn't work. fails with the same error.

raimannma commented 3 years ago

What about this file? https://gist.github.com/raimannma/95706ec9af955a413b25161b72e075e9 Now build with webpack

tracycollins commented 3 years ago

@tracycollins can you check if it works on this branch? https://github.com/liquidcarrot/carrot/tree/FIX_244_regenerator_runtime_error

no, didn't work. fails with the same error.

SORRY!

THIS DOES WORK

Pilot error when I tested it before. Haven't tried your 2nd fix yet

tracycollins commented 3 years ago

Also, sorry for the delay. I'm in a class...

raimannma commented 3 years ago

ok, so my first commit fixes your problem ?

If so, i would push it to master.

tracycollins commented 3 years ago

yes, push please

raimannma commented 3 years ago

Just waiting for approve from @christianechevarria or @luiscarbonell .

tracycollins commented 3 years ago

I'm sorry, but it seems that this was never fixed; I had pinned the version to 0.3.18 and wasn't testing against the latest version, v0.3.20, which fails.

running on node 12.18.3

To reproduce, a file with only the following line fails with the error 'MODULE_NOT_FOUND'

let { Network, methods } = require('@liquid-carrot/carrot');

the error message:

internal/modules/cjs/loader.js:968 throw err; ^

Error: Cannot find module './architecture/network' Require stack:

  • /Volumes/RAID1/projects/neuralNetworkTools/node_modules/@liquid-carrot/carrot/dist/index.min.js
  • /Volumes/RAID1/projects/neuralNetworkTools/testing.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15) at Function.Module._load (internal/modules/cjs/loader.js:841:27) at Module.require (internal/modules/cjs/loader.js:1025:19) at require (internal/modules/cjs/helpers.js:72:18) at /Volumes/RAID1/projects/neuralNetworkTools/node_modules/@liquid-carrot/carrot/dist/index.min.js:1:166451 at Object. (/Volumes/RAID1/projects/neuralNetworkTools/node_modules/@liquid-carrot/carrot/dist/index.min.js:1:172944) at Module._compile (internal/modules/cjs/loader.js:1137:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10) at Module.load (internal/modules/cjs/loader.js:985:32) at Function.Module._load (internal/modules/cjs/loader.js:878:14) { code: 'MODULE_NOT_FOUND', requireStack: [ '/Volumes/RAID1/projects/neuralNetworkTools/node_modules/@liquid-carrot/carrot/dist/index.min.js', '/Volumes/RAID1/projects/neuralNetworkTools/testing.js' ] }
raimannma commented 3 years ago

@christianechevarria Maybe this comes from the dependency updates in version 0.3.19

christianechevarria commented 3 years ago

The issue particularly is in the dist so I'm guessing this is Webpack / Rollup related

ragnorc commented 3 years ago

Same issue with 0.3.20. Cannot find module './architecture/network'