tomasreimers / tensorflow-emscripten

VERY MUCH A WORK IN PROGRESS & ACTIVE RESEARCH PROJECT -- DO NOT USE.
Apache License 2.0
56 stars 8 forks source link

run example_without_lib.js error: need 3.1.0 Protocol Buffer runtime library #2

Open jiangzidong opened 7 years ago

jiangzidong commented 7 years ago

Hi I build the js according to #1 (in ubuntu, changing libprotobuf.a to libprotobuf.so)

And I run example_without_lib.js, and it reports error:

node example_without_lib.js
[libprotobuf FATAL google/protobuf/stubs/common.cc:68] This program requires version 3.1.0 of the Protocol Buffer runtime library, but the installed version is 3.0.0.  Please update your library.  If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library.  (Version verification failed in "/home/dd/ml/tf-em/tensorflow/contrib/makefile_js/gen/proto/tensorflow/core/framework/kernel_def.pb.cc".)

/home/dd/ml/tf-em/tensorflow/contrib/makefile_js/gen/bin/graph_runner.js:1
(function (exports, require, module, __filename, __dirname) { var Module;if(!Module)Module=(typeof TensorFlowJS!=="undefined"?TensorFlowJS:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;if(Module["ENVIRONMENT"]){if(Module["ENVIRONMENT"]==="WEB"){ENVIRONMENT_IS_WEB=true}else if(Module["ENVIRONMENT"]==="WORKER"){ENVIRONMENT_IS_WORKER=true}else if(Module["ENVIRONMENT"]==="NODE"){ENVIRONMENT_IS_NODE=true}else if(Module["ENVIRONMENT"]==="SHELL"){ENVIRONMENT_IS_SHELL=true}else{throw new Error("The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.")}}else{ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeo
10084424

Have you met the similar error before? the protoc in my host machine is 3.1.0, while in your protobuf-emscripten repo, the version seems 3.0.0. Am I right about it?

tomasreimers commented 7 years ago

Yup, seems that you are correct! Will update the repository soon (have one major push on this repo coming out very soon -- including documentation, and then I'll start addressing Ubuntu).

In the meanwhile, one fix might be to downgrade protoc, just to verify that it works.

jiangzidong commented 7 years ago

Update my status in ubuntu:

After I upgrade the emscripten-protobuf from 3.0 to 3.1, there is no version error. But I got the following error:

$ node example_with_lib.js
can't determine number of CPU cores: assuming 4

/home/jzd/ml/tf-em/tensorflow/contrib/makefile_js/gen/bin/graph_runner.js:1
(function (exports, require, module, __filename, __dirname) { var Module;if(!Module)Module=(typeof TensorFlowJS!=="undefined"?TensorFlowJS:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;if(Module["ENVIRONMENT"]){if(Module["ENVIRONMENT"]==="WEB"){ENVIRONMENT_IS_WEB=true}else if(Module["ENVIRONMENT"]==="WORKER"){ENVIRONMENT_IS_WORKER=true}else if(Module["ENVIRONMENT"]==="NODE"){ENVIRONMENT_IS_NODE=true}else if(Module["ENVIRONMENT"]==="SHELL"){ENVIRONMENT_IS_SHELL=true}else{throw new Error("The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.")}}else{ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeo
11750064
jiangzidong commented 7 years ago

Hi @tomasreimers Any progress on the document and ubuntu?