Code Monkey home page Code Monkey logo

Comments (9)

justin1121 avatar justin1121 commented on May 24, 2024 1

Actually I think its just a problem finding the module. From the root directory try running pip install -e . and running model_run.py again.

from tf-trusted.

justin1121 avatar justin1121 commented on May 24, 2024

Hey there,

Try running model_run.py from the root directory. Like:

python tf_trusted_custom_op/model_run.py <args>

from tf-trusted.

tgamal avatar tgamal commented on May 24, 2024

Thanks Justin for the prompt reply, unfortunately I still have the same error

python3 tf_trusted_custom_op/model_run.py --model_file ~/inception5h/tensorflow_inception_graph.pb --input_file ~/data_npy/3892.npy --input_name input --output_name output
Traceback (most recent call last):
File "tf_trusted_custom_op/model_run.py", line 7, in
import tf_trusted_custom_op as tft
ModuleNotFoundError: No module named 'tf_trusted_custom_op'

Does it matter if I run it inside the tf_trusted_custom_op container or in the host machine ? I am running it in the host machine

from tf-trusted.

justin1121 avatar justin1121 commented on May 24, 2024

If the host machine is a linux box then there's a good chance that it should still work. I'm not sure this is problem though. I'd give that a try to start though.

from tf-trusted.

tgamal avatar tgamal commented on May 24, 2024

so I think since the build completes successfully, but my installed python version cannot see the new custom op, is there a way I should copy this file "model_enclave_op.so" somewhere else so it can be seen by my installed python version. I am not sure how python imports the custom_op

from tf-trusted.

tgamal avatar tgamal commented on May 24, 2024

Thanks @justin1121 the custom_op is now installed but I have another issue. When I try to run model_run.py, it gives me the following error

bazel-out/k8-fastbuild/genfiles/external/local_config_tf/include/tensorflow/core/lib/core/refcount.h:90] Check failed: ref_.load() == 0 (1 vs. 0)

My environment is ubuntu 18.04, python 3.6.8, tensorflow 1.13.1

I tried to search for solution, and the proposed workaround here (tensorflow/tensorflow#17316) is to add the flag -DNDEBUG in the compiler_flags of the custom_op, I tried to append this flag to the TF_CFLAGS in tf_trusted_custom_op/configure.sh but It did not work for me ? Please advise if you have faced that error before

from tf-trusted.

justin1121 avatar justin1121 commented on May 24, 2024

I've run into this issue in the past before but its happened to me sporadically and never found a good solution. Seems to me some form of the issue you found would be a good way to solve. I don't think bazel looking at the TF_CFLAGS so I'd try adding it to the BUILD file https://github.com/dropoutlabs/tf-trusted/blob/master/tf_trusted_custom_op/BUILD#L31. Like:

    copts = ["-pthread", "-std=c++11", "-D_GLIBCXX_USE_CXX11_ABI=0", -DNDEBUG]

Let me know if that works. Also if you feel up to it it'd be great if you could submit documentation changes and whatever other changes you end up creating. Thanks!

from tf-trusted.

tgamal avatar tgamal commented on May 24, 2024

Hi justin, thanks alot, it works now after I did this modification. What would be the best way to update the documentation with this workaround. Should I submit a change to the README file of the custom_op repo ?

from tf-trusted.

justin1121 avatar justin1121 commented on May 24, 2024

Hey, you can update the BUILD file directly with the -DNDEBUG flag like above and then add something to the README.md about making sure tf_trusted_custom_op is installed before running the model_run.py script.

from tf-trusted.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.