Giter Site home page Giter Site logo

v-sundaresan / truenet Goto Github PK

View Code? Open in Web Editor NEW
11.0 2.0 5.0 96.71 MB

DL tool for white matter hyperintensities segmentation

Python 82.59% Shell 17.41%
unet unet-image-reconstruction pytorch segmentation deep-learning lesion-segmentation mri triplanar-architecure white-matter-hyperintensities domain-adaptation

truenet's People

Contributors

markj789 avatar pauldmccarthy avatar v-sundaresan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

truenet's Issues

Problem accessing 'lit' library

I have encountered the following issue on multiple computers (Ubuntu 23.04, Python3).

It seems that there are problems interacting with 'lit'.

However my environment reports the following upon 'pip install lit':
Requirement already satisfied: lit in /home/chris/venv/lib/python3.11/site-packages (16.0.6)

Do you have any suggestions for overcoming it?

------------------------------------------------------------------ERROR MESSAGE-----------------------------------------------------------------

truenet evaluate
Traceback (most recent call last):
File "/usr/local/bin/truenet", line 4, in
import('pkg_resources').run_script('truenet==1.0.1', 'truenet')
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 3248, in
@_call_aside
^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 3223, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 3261, in _initialize_master_working_set
working_set = WorkingSet._build_master()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 617, in _build_master
ws.require(requires)
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 956, in require
needed = self.resolve(parse_requirements(requirements))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 815, in resolve
dist = self._resolve_dist(
^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 856, in _resolve_dist
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'lit' distribution was not found and is required by triton

Gpu Recognition

Hello,
I used Anaconda Navigator to setup an env with Python 3.6.13 and torch 1.5.0 and get the following error. Notably, CUDA is True and the GPU is available.
Advice appreciated.
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/truenet", line 4, in
import('pkg_resources').run_script('truenet==1.0.1', 'truenet')
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 708, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 1528, in run_script
exec(script_code, namespace, namespace)
File "/usr/local/lib/python3.11/dist-packages/truenet-1.0.1-py3.11.egg/EGG-INFO/scripts/truenet", line 156, in
File "/usr/local/lib/python3.11/dist-packages/truenet-1.0.1-py3.11.egg/truenet/true_net/truenet_commands.py", line 277, in evaluate
File "/usr/local/lib/python3.11/dist-packages/truenet-1.0.1-py3.11.egg/truenet/true_net/truenet_test_function.py", line 98, in main
File "/usr/local/lib/python3.11/dist-packages/truenet-1.0.1-py3.11.egg/truenet/utils/truenet_utils.py", line 65, in loading_model
File "/usr/lib/python3/dist-packages/torch/serialization.py", line 795, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/torch/serialization.py", line 1012, in _legacy_load
result = unpickler.load()
^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/torch/serialization.py", line 958, in persistent_load
wrap_storage=restore_location(obj, location),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/torch/serialization.py", line 215, in default_restore_location
result = fn(storage, location)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/torch/serialization.py", line 182, in _cuda_deserialize
device = validate_cuda_device(location)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/torch/serialization.py", line 166, in validate_cuda_device
raise RuntimeError('Attempting to deserialize object on a CUDA '
RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.
(truenet) roger@roger:~$ python3.6
Python 3.6.13 |Anaconda, Inc.| (default, Jun 4 2021, 14:25:59)
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import torch
print("CUDA available: ", torch.cuda.is_available())
CUDA available: True
print("Number of GPUs available: ", torch.cuda.device_count())
Number of GPUs available: 1

TypeError: can only concatenate str (not "torch.device") to str

Hi, thanks for this this great tool! We followed the basic installation instructions and would like to use one of the trained models, but we keep getting a strange concatenation error. It looks like device isn't a string, so in places where you have print('testfunction:device used:' + device) maybe print('testfunction:device used:' + str(device)) would work?

Our command and the output are pasted below.

truenet evaluate -i testing-truenet-dvs/sub-10866_testing -m mwsc -o testing-truenet-dvs/sub-10866_results
FLAIR image found for sub-10866
Traceback (most recent call last):
  File "/ZPOOL/data/tools/anaconda/tug87422/anaconda3/bin/truenet", line 4, in <module>
    __import__('pkg_resources').run_script('truenet==1.0.1', 'truenet')
  File "/ZPOOL/data/tools/anaconda/tug87422/anaconda3/lib/python3.11/site-packages/pkg_resources/__init__.py", line 720, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/ZPOOL/data/tools/anaconda/tug87422/anaconda3/lib/python3.11/site-packages/pkg_resources/__init__.py", line 1570, in run_script
    exec(script_code, namespace, namespace)
  File "/ZPOOL/data/tools/anaconda/tug87422/anaconda3/lib/python3.11/site-packages/truenet-1.0.1-py3.11.egg/EGG-INFO/scripts/truenet", line 159, in <module>
  File "/ZPOOL/data/tools/anaconda/tug87422/anaconda3/lib/python3.11/site-packages/truenet-1.0.1-py3.11.egg/truenet/true_net/truenet_commands.py", line 409, in evaluate
  File "/ZPOOL/data/tools/anaconda/tug87422/anaconda3/lib/python3.11/site-packages/truenet-1.0.1-py3.11.egg/truenet/true_net/truenet_test_function.py", line 38, in main
TypeError: can only concatenate str (not "torch.device") to str

Docker

We are very interested in applying this to our acute stroke data sample (over 3000 participants).
Are there any plans for a docker image?
I have been having trouble getting both the preparation and evaluation commands to recognize the GPU and proper CUDA libraries (leading to 2 separate Ubuntu reinstalls!0
Thanks!
Roger

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.