GithubHelp home page GithubHelp logo

uresnet_pytorch's Introduction

uresnet_pytorch

PyTorch implementations of dense and sparse UResNet

This README is very rough and will be completed soon. Stay tuned!

Software containers

Singularity containers are available on https://www.singularity-hub.org/containers/6596.

Dataset

LArTPC simulation dataset are publicly available on https://osf.io/9b3cv/.

Run

All options can be found in uresnet/flags.py.

To train sparse U-ResNet you can use for example:

python bin/uresnet.py train -chks 500 -wp weights/snapshot -io larcv_sparse -bs 1 --gpus 0 -nc 5 -rs 1 -ss 512 -dd 3 -uns 5 -uf 16 -dkeys data,fivetypes -mn uresnet_sparse -it 10 -ld log -if your_data.root

To run the inference:

python bin/uresnet.py inference --full -mp weights/snapshot-1000.ckpt -io larcv_sparse -bs 1 --gpus 0 -nc 5 -rs 1 -ss 512 -dd 3 -uns 5 -uf 16 -dkeys data,fivetypes -mn uresnet_sparse -it 10 -ld log -if your_data.root

Main command-line parameters:

  • -mn model name, can be uresnet_dense or uresnet_sparse
  • -io I/O type, can be larcv_sparse or larcv_dense
  • -nc number of classes
  • -chks save checkpoint every N iterations
  • -wp weights directory
  • -bs batch size
  • --gpus list gpus
  • -rs report every N steps in stdout
  • -ss spatial size of images
  • -dd data dimension (2 or 3)
  • -uns U-ResNet depth
  • -uf U-ResNet initial number of filters
  • -dkeys data keys in LArCV ROOT file
  • -it number of iterations
  • -ld log directory
  • -if input file
  • -mp weight files to load for inference

Authors

Laura Domine & Kazuhiro Terao

uresnet_pytorch's People

Contributors

temigo avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

uresnet_pytorch's Issues

Inference does not work without --full flag

Within the inference_loop(flags, handlers) function, the print functions raise an error.

Here's the command I run:
python bin/uresnet.py inference -mp weights/snapshot-2999.ckpt -io larcv_sparse -bs 1 --gpus 0 -nc 5 -rs 1 -ss 512 -dd 3 -uns 5 -uf 16 -dkeys data,fivetypes -mn uresnet_sparse -it 100 -ld log -if '/gpfs/slac/staas/fs1/g/neutrino/kterao/data/dlprod_ppn_v10/shower_relabel/dlprod_512px_09.root'
Here's the error:

Traceback (most recent call last):
  File "bin/uresnet.py", line 14, in <module>
    main()
  File "bin/uresnet.py", line 11, in main
    flags.parse_args()
  File "/u/nu/drielsma/uresnet/uresnet_pytorch/uresnet/flags.py", line 153, in parse_args
    args.func(self)
  File "/u/nu/drielsma/uresnet/uresnet_pytorch/uresnet/main_funcs.py", line 56, in inference
    inference_loop(flags, handlers)
  File "/u/nu/drielsma/uresnet/uresnet_pytorch/uresnet/main_funcs.py", line 242, in inference_loop
    np.unique(np.argmax(res['segmentation'][0], axis=0)[(data_blob['data'][0]>0)[0, 0, ...]], return_counts=True),
TypeError: 'bool' object has no attribute '__getitem__'

NB: data_blob['data'][0]>0 is bool

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.