Comments (2)
We don't expect both frameworks to be installed. Should probably do conditional imports to import only what's available.
I put the import in init to simplify importing and calling the functions. The user shouldn't need to specifically import PyTorch or TF specific modules. I would keep the imports in init but update the other modules to not throw an error if a framework they don't need is not available.
from hiddenlayer.
I'm personally a big fan of the following notation:
from ww import builder_tf
It doesn't require that you explicitly import anything in __init__.py
. You can test this with the new setup.py
file I've included. Just run the following command to install the package in your environment:
$ pip install .
Processing e:\repos\ww-dev
Building wheels for collected packages: weightwatcher
Running setup.py bdist_wheel for weightwatcher ... done
Stored in directory: C:\Users\Phil\AppData\Local\pip\Cache\wheels\17\e2\0c\1237efb07e9b9cdd2a3e1621a699435738275e3fcb15108535
Successfully built weightwatcher
distributed 1.21.8 requires msgpack, which is not installed.
Installing collected packages: weightwatcher
Successfully installed weightwatcher-0.1
It also doesn't introduce the problem of having to deal with conditional imports. It also doesn't make the code blow-up just by importing the package. Of course, no matter what, if the relevant DL framework is not installed, you will get into trouble when importing the ww TF or PyTorch builder.
from hiddenlayer.
Related Issues (20)
- AttributeError: module 'torch.onnx' has no attribute '_optimize_trace' HOT 7
- May I get the very first and last tensor shape?
- module 'torch.jit' has no attribute '_get_trace_graph' HOT 3
- Pytorch Model Branch Duplication
- AttributeError: module 'torch.jit' has no attribute '_get_trace_graph' HOT 3
- ONNX symbolic expected a constant value of the rand argument
- tensor shapes not displayed in rendered graph HOT 5
- can it show variable name at every node?
- demo pytorch_graph.ipynb not working
- How to display branch nodes / parallel blocks HOT 2
- Not displaying graph as expected in Jupyter Notebook (either during training or after training) HOT 1
- How exactly should look the second parametr?
- build_graph() does not return HOT 2
- AttributeError: 'Digraph' object has no attribute '_repr_svg_' HOT 2
- How to display dimensions and change font to Times HOT 1
- TypeError for Pytorch Model HOT 4
- support yolov5 HOT 2
- Error when trying to print the Model
- Error while trying to run the example
- How to plot bert model? (Transfomer models) HOT 1
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 hiddenlayer.