GithubHelp home page GithubHelp logo

Comments (9)

pfjaeger avatar pfjaeger commented on June 1, 2024

hi. What is the shape of the data array, which your 'generate_train_batch' method returns?
it should be (batch, channel, x, y, (z)). If you are using the lidc data loader as a starting point, note, that it has a dummy dimension for channels already (np.newaxis in line 232).

from medicaldetectiontoolkit.

cammu00 avatar cammu00 commented on June 1, 2024

Hi, Thank you for your response.
The shape of my data is (4, 240,240,155)
I modified the lidc data loader like following this:
#data = np.transpose(np.load(patient['data'], mmap_mode='r'), axes=(1, 2, 0))[np.newaxis]
data = np.transpose(np.load(patient['data'], mmap_mode='r'), axes=(0, 1, 2, 3))[np.newaxis]
and generate_train_batch returns (4, 1, 4, 156, 96, 240).

Best,
David.

from medicaldetectiontoolkit.

cammu00 avatar cammu00 commented on June 1, 2024

Sorry, just in case.
If I run n_channel dataset, do I have to match data shape with seg_data(roi mask)?

best,
David.

from medicaldetectiontoolkit.

pfjaeger avatar pfjaeger commented on June 1, 2024

you need to get rid of the [np.newaxis]. This introduces a dummy channel dimension for lidc data, which you dont need. As I said, check that generate_train_batch returns (batch, channel, x, y, (z))

from medicaldetectiontoolkit.

pfjaeger avatar pfjaeger commented on June 1, 2024

the seg should have shape (batch, 1, x, y, (z)) and contain class labels as integer values.

from medicaldetectiontoolkit.

cammu00 avatar cammu00 commented on June 1, 2024

Thank you. training code now is work!
But I met an error after first epoch following like this:
Traceback (most recent call last):
File "exec.py", line 172, in
train(logger)
File "exec.py", line 85, in train
, monitor_metrics['train'] = train_evaluator.evaluate_predictions(train_results_list, monitor_metrics['train'])
File "/data2/project/keras/medicaldetectiontoolkit/evaluator.py", line 191, in evaluate_predictions
return self.return_metrics(monitor_metrics)
File "/data2/project/keras/medicaldetectiontoolkit/evaluator.py", line 298, in return_metrics
plotting.plot_stat_curves(all_stats, out_filename)
File "/data2/project/keras/medicaldetectiontoolkit/plotting.py", line 263, in plot_stat_curves
plt.plot(s[c][0], s[c][1], label=s['name'] + '
' + c)
TypeError: 'float' object is not subscriptable

Do you comment for this how to resolve it?
Many thanks,

Best,
David.

from medicaldetectiontoolkit.

pfjaeger avatar pfjaeger commented on June 1, 2024

hi by default the plot_stat_curves are switched off in configs, because in most scenarios they are less informative than the prediction histograms. Did you intentionally switch on this flag in the configs? As for your error I was not able to reproduce this. For Debugging I recommend to print our your all_stats list and check if it has the expected structure.

from medicaldetectiontoolkit.

cammu00 avatar cammu00 commented on June 1, 2024

Hi, Thank you. I didn't realize that I did switch on it in configs. I did back to off and now it's working well.
Thank you for your help :).

Best,
David.

from medicaldetectiontoolkit.

pfjaeger avatar pfjaeger commented on June 1, 2024

glad I could help. Feel free to join our new slack channel for further discussion: https://join.slack.com/t/mdtoolkit/shared_invite/enQtNTQ3MjY2MzE0MDg2LWNjY2I2Njc5MTY0NmM0ZWIxNmQwZDRhYzk2MDdhM2QxYjliYTcwYzhkNTAxYmRkMDA0MjcyNDMyYjllNTZhY2M

from medicaldetectiontoolkit.

Related Issues (20)

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.