Comments (10)
@wuzhiyu666 Can you go into more detail by what you mean when you say "when running"? Is it possible that you are possibly not using Bazel to run the models_test
target?
bazel test tensorflow_federated/python/examples/mnist:models_test
You can see that there is a protobuf computation.proto located at the path that you referenced. Bazel will resolve these dependencies and eventually generate the python that you are looking for computation_pb2
from the computation.proto
.
Take a look at our installation instructions for how to install Bazel and test TFF.
from federated.
thank you so much! I will try it.
from federated.
Sorry, when I used bazel to compile the code, it took 2 hours and failed in the end. when I say "when running", I am running the code "models_test
" in pycharm. I have question that can I run the code in pycharm locally without bazel and docker?
Thank you so much! @michaelreneer
from federated.
So there are a few things here:
-
It's possible that it would take 2 hours to build. TFF has a source-level dependency on TensorFlow so you end up building TFF from source. This entirely depends on your machine.
-
We have a hard dependency on protobuf and converting the
computation.proto
in to the missingcomputation_pb2
. Which practically means that we also have a dependency on Bazel. We don't have a dependency on Docker, you could usevirtualenv
to create a local environment. Docker orvirtaulenv
are used here to keep the pip package dependencies separated from the system Python. -
You can use pycharm as an IDE if you want, but you still need to compile the protobuf. You would also need to install the packages that we do not build from source, you can find those in the
requirements.txt
. -
I am curious about the error that you got after it took 2 hours to build. Did you happen to save the log? What command ended up failing?
Keep in mind you don't need to build everything from source to use TFF, you can instead pip install the pip package. You would not be able to run the unit tests by only installing the pip package, but you could use and play with the API.
from federated.
Thank you so much! @michaelreneer
Sorry for the late reply, I have reinstalled my operating system and run bazel again. But I got a new problem. The bazel have used up all my RAM and crash my computer.
Could you please tell me how to sovle the problem?
Thank you!
from federated.
I have a new question that if using bazel is not mandatory, is there another demo can I run without bazel?
I am new to federated-leaning and just want to run a demo to see how it works.
Thank you! @michaelreneer
from federated.
Hi @wuzhiyu666,
If you are looking for a demo, the place I would start is the Colab notebooks linked from tensorflow.org/federated, under tutorials, e.g.:
https://www.tensorflow.org/federated/tutorials/federated_learning_for_image_classification
If you open these notebooks, you will see a button for "open in Google Colab"; this will connect you to a runtime which allows you to step through the code and text, executing code block-by-block.
Hopefully this is what you are looking for! We are happy to hear of your interest in federated learning!
from federated.
As I mentioned before you can simply install the pip package to use TFF or you could do as @jkr26 suggested and run one of the TFF tutorials directly in your browser in Colab. I would strongly recommend one of these approachs, the easiest is simply running the notebook in your browser.*
Bazel is required to build TFF source. If you are having issues with Bazel RAM usage, you can check out this bazel build options documentation from TensorFlow or the Bazel documentation on the local_resources flag.
from federated.
@wuzhiyu666 As a data point for us, would you mind sharing the specs of your machine?
from federated.
Hi!
The error "ImportError: cannot import name 'computation_pb2'" still appears when running
python -c "import tensorflow_federated as tff; print(tff.federated_computation(lambda: 'Hello World')())"
even after installation of TF Fedefrated via Bazel. At the same time running
bazel test tensorflow_federated/python/examples/mnist:models_test
performs well, with no error.
Specs:
MacOS Sierra 10.12
Python 3.6
PyCharm CE 2019 IDE
Conda env
from federated.
Related Issues (20)
- Implemented simulation tff code to be distribute from server to clients. HOT 2
- LearningProcess Compatibility Error HOT 2
- An error went when I ran pip install --upgrade tensorflow-federated HOT 2
- AttributeError: module 'tensorflow._api.v2.nest' has no attribute 'map_struture' HOT 1
- Documentation Issue - build_fed_kmeans HOT 1
- Error installing Tensorflow Federated with Python 3.9 HOT 4
- OperatorNotAllowedInGraphError Traceback (most recent call last)
- TFF using model resnet,the val accuracy has always been a result of random guessing
- AttributeError: module 'numpy' has no attribute '_no_nep50_warning' when importing TensorFlow Federated HOT 6
- Installation failed HOT 10
- Facing error in "Learning Attribute" Please Help. HOT 2
- tff.federated_computation(lambda: 'Hello World!')() stuck/hanging HOT 6
- Stuck at learning_process.initialize() and tff.federated_computation(lambda: 'Hello, World!')() HOT 1
- Security policy for tensorflow federated?
- Colab stuck at learning_process.initialize() HOT 14
- Exploding memory while training federated model on FLAIR Dataset HOT 3
- No GPU utilization when using the cpp execution context HOT 1
- perform cross-silo federated learning by TFF HOT 2
- Installtion failed HOT 5
- Keras 3 and TF 16.1 support HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from federated.