Comments (5)
As discussed in #436, there are float16 issues with both the ImageDataGenerators and the model zoo.
from deepcell-tf.
It looks like this is supported as mixed precision in TensorFlow 2.
from deepcell-tf.
This is indeed supported natively by TensorFlow 2:
from tensorflow.keras import mixed_precision
# On TPUs, use 'mixed_bfloat16' instead
mixed_precision.experimental.set_policy('mixed_float16')
# On TensorFlow 2.4.1:
# mixed_precision.set_global_policy('mixed_float16')
I tried training the Nuclear Segmentation notebook using the mixed-precision above. However, I found that it caused a significant slowdown during training. (epoch goes from 10 minutes to 60+ minutes). I'm not sure if this is due to our data generators or something about our PanOpticNet model architecture - more debugging is required.
from deepcell-tf.
Mixed precision works in TensorFlow 2.4.1!
However, it looks like std
and max
normalizations have an issue with mixed precision:
TypeError: Input 'filter' of 'DepthwiseConv2dNative' Op has type float32 that does not match type float16 of argument 'input'.
The root cause is that the layer's kernel was initialized using K.floatx
which is not changed when setting the global precision policy. This is resolved in #490
from deepcell-tf.
While #490 does allow mixed-precision training without any warnings or errors, it does not seem to improve training performance. I get roughly the same training time (running the Nuclear Segmentation PanOpticNet notebook) using mixed precision and float32 while testing different settings (Location, normalization method, interpolation upsample_type, etc).
That said, mixed-precision DOES enable much larger batch sizes than with float32 mode, so it is indeed working.
from deepcell-tf.
Related Issues (20)
- Incompatible shape of testing dataset in Nuclear Segmentation notebook HOT 6
- Tissuenet dataset instance segmentation ground truth HOT 11
- DEEPCELL_ACCESS_TOKEN HOT 6
- Link nucleus to whole cell segmentation mask mesmer HOT 3
- Getting cell segmentation mask file from Mesmer standalone program HOT 1
- QUERY : Segmentation Issue HOT 2
- Nuclear and whole cell segmentation masks identical HOT 4
- Question regarding pixel expansion HOT 1
- Retrieve model output without postprocessing
- Access token needed HOT 1
- Segmentation Mask Output HOT 1
- Segmentation Mask FIle Issues HOT 1
- MacBook M3 support, DeepCell cannot be installed due to tensorflow version HOT 2
- Error creating segmentation masks for small images HOT 3
- Align for multi fov result combined HOT 1
- Support for Python 3.11? HOT 1
- DeepCell API Key SignUp page responds with a Server Error HOT 4
- Support for Python 3.11 onward HOT 2
- Upgrade (or widen) supported `tensorflow` version HOT 6
- interrupted by signal 4: SIGILL 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 deepcell-tf.