Comments (6)
I haven't messed with PyTorch 1.0 tracing features yet. However, this is something that interests me and that I would like very much to support.
Both modules will have indeed to be converted to TorchScript due to control flow.
I'll have a look today to see if I can get any progress.
from dropblock.
@mdraw I'm surprised you had no errors tracing the DropBlock2D
module. I'm converting it to ScriptModule
and it requires a bunch of subtle changes in the code.
from dropblock.
I think it might not be possible to trace the LinearScheduler
because it changes the value of the drop_prob
of a module, which I think can not be done with TorchScript.
I have to investigate this, however.
from dropblock.
I'm surprised you had no errors tracing the DropBlock2D module.
In my (limited) experience, implementing things as ScriptModules
is currently pretty hard because of the limited language and library features that the compiler understands, but tracing has somehow worked even for complicated models - although you have to watch out for code that the tracer doesn't recognize.
I think it might not be possible to trace the LinearScheduler because it changes the value of the drop_prob of a module, which I think can not be done with TorchScript
Yes, I also don't know how this could be done. __constants__
work fine for constants, but I don't see any way to define module-level variables that you can change dynamically. I just checked: torch.nn.Dropout2d
doesn't support changing p
either if it's in ScriptModule form.
Besides this issue, your implementation in #27 looks good to me. DropBlock2D
and DropBlock3D
work as intended now in my local tests.
from dropblock.
Yes, the DropBlock modules are now working fine. I didn't merge yet due to the LinearScheduler. I will do some more research but I really think it is not possible at the moment
from dropblock.
closing this as DropBlock does not benefit from JIT scripting, as it can be traced for inference time without problems.
from dropblock.
Related Issues (20)
- inconsistency with the original paper HOT 9
- same results as traditional dropout if block_size=1 HOT 1
- How to put in evaluation mode? HOT 1
- DropBlock1D HOT 3
- DropBlock at Residual Connections HOT 1
- resnet-cifar10.py DropBlock scheduler HOT 1
- Is it needed to somehow turn off Dropblock layer during inference time? HOT 1
- Pytorch Lightning as a back-end HOT 2
- Where to put the dropblock in the ResNet network? HOT 1
- The examples for using dropblock is different? HOT 1
- why drop_prob in config.yaml is 0 HOT 1
- Pre-trained ResNet50 model on ImageNet? HOT 1
- Would you please tell me how did you make certain the positive area of the mask keep still after max pooling operation ? HOT 6
- Can I use with torch.no_grad() in the forward of dropblock.py? HOT 4
- Use in segmentation. You suggest only for convolution feature extraction layer only. What do you mean? HOT 2
- Dropblock and python version HOT 3
- 'ResNetCustom' object has no attribute '_norm_layer' HOT 2
- make dropblock run faster HOT 1
- shared DropBlock mask across different feature channels
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 dropblock.