Spaces:
Build error
Build error
Download util/lua/remove_batchnorm.lua from rawanessam/FloorPlanTransformation: direct link, hf CLI and curl.
- Browser
- Download file 656 Bytes
-
https://huggingface.co/spaces/rawanessam/FloorPlanTransformation/resolve/main/util/lua/remove_batchnorm.lua
- Command line
-
hf download hf://spaces/rawanessam/FloorPlanTransformation/util/lua/remove_batchnorm.lua
-
curl -L -o remove_batchnorm.lua https://huggingface.co/spaces/rawanessam/FloorPlanTransformation/resolve/main/util/lua/remove_batchnorm.lua
656 Bytes
| -- Load all common packages. | |
| require 'nn' | |
| require 'cunn' | |
| require 'cudnn' | |
| require 'fbnn' | |
| require 'fbcunn' | |
| local nnutils = require 'fbcode.deeplearning.experimental.yuandong.utils.nnutils' | |
| local pl = require 'pl.import_into'() | |
| local opt = pl.lapp[[ | |
| -i,--input (default "") Input model | |
| -o,--output (default "") Output model | |
| ]] | |
| local saved_check_point = torch.load(opt.input) | |
| local model | |
| if type(saved_check_point) == 'table' then | |
| saved_check_point.model = nnutils.remove_batchnorm(saved_check_point.model) | |
| else | |
| saved_check_point = nnutils.remove_batchnorm(saved_check_point) | |
| end | |
| torch.save(opt.output, saved_check_point) | |