Comments (9)
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.
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.
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.
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.
the seg should have shape (batch, 1, x, y, (z)) and contain class labels as integer values.
from medicaldetectiontoolkit.
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.
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.
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.
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)
- Compile Cuda Functions Help
- Question about "min_det_thresh" in test plotting
- troubles with MultiThreadedAugmenter HOT 2
- Problem with one class training HOT 4
- How could I preprocess my own nii data? HOT 2
- out of memory ConvertSegToBoundingBoxCoordinates
- How should I prepare the dataset? HOT 1
- inference issue
- Compiling CUDA functions for Titan RTX HOT 1
- data_load is very very very slow?
- how to improve the speed of test?
- Batch generation error on my customized dataset HOT 1
- KeyError when trying to train in toy_exp HOT 3
- TypeError: crop_and_resize_forward expected 7 arguments, got 8 when running on cpu
- How can I only evaluate based on the ground-truth bounding box? HOT 1
- When using batch_generator, where should I put "boxes_coords" in? HOT 1
- only a single thread working in "MultiThreadedAugmenter " !
- How to write U-Net Deep Learning code dealing with ".tiff" images?
- Project dependencies may have API risk issues
- Can you share the preprocessed LIDC dataset,Thank you HOT 1
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 medicaldetectiontoolkit.