Comments (7)
Yes! It is working now 😁 Thanks!
from gandlf.
No worries at all, this helps us with stress testing, so thank you! 😄
This could be due to the resampling. Could you try the following:
data_preprocessing:
{
# 'normalize',
'normalize_nonZero', # this performs z-score normalization only on non-zero pixels
}
from gandlf.
I will also recommend to keep the configuration as light as possible for the toy examples (basically, let the defaults ride). Essentially, the configs in the testing module should be your starting point. 😄 🚀
from gandlf.
Will do :)
Old error is fixed, new one is this 😄:
This option has been superceded by 'model'
Number of channels : 3
Channel Keys : ['subject_id', '1', '2', '3', 'label', 'path_to_metadata', 'value_0']
Initializing training at : 2021-03-28 13:12:04.708672
Found a pre-existing file for logging, now appending logs to that file!
Found a pre-existing file for logging, now appending logs to that file!
Device requested via CUDA_VISIBLE_DEVICES: 0
Total number of CUDA devices: 1
Device finally used: 0
Sending model to aforementioned device
Memory Total : 14.8 GB, Allocated: 0.1 GB, Cached: 0.1 GB
Device - Current: 0 Count: 1 Name: Tesla T4 Availability: True
Using device: cuda
********************
Starting Epoch : 0
Epoch start time : 2021-03-28 13:12:07.872670
/usr/local/lib/python3.7/dist-packages/torch/nn/modules/loss.py:528: UserWarning: Using a target size (torch.Size([1, 1])) that is different to the input size (torch.Size([1, 2])). This will likely lead to incorrect results due to broadcasting. Please ensure they have the same size.
return F.mse_loss(input, target, reduction=self.reduction)
Epoch Average Train loss : tensor(1.6588, device='cuda:0', grad_fn=<DivBackward0>)
Epoch Average Train mse : tensor(1.6588, device='cuda:0', grad_fn=<DivBackward0>)
Epoch Average Train loss : tensor(0.9822, device='cuda:0', grad_fn=<DivBackward0>)
Epoch Average Train mse : tensor(0.9822, device='cuda:0', grad_fn=<DivBackward0>)
********************
Starting validation :
********************
Traceback (most recent call last):
File "gandlf_run", line 75, in <module>
main()
File "gandlf_run", line 70, in main
TrainingManager(dataframe=data_full, headers = headers, outputDir=model_path, parameters=parameters, device=device, reset_prev = reset_prev)
File "/content/GaNDLF-refactor/GANDLF/training_manager.py", line 146, in TrainingManager
device=device, params=parameters, testing_data=testingData)
File "/content/GaNDLF-refactor/GANDLF/training_loop.py", line 480, in training_loop
model, val_dataloader, params
File "/content/GaNDLF-refactor/GANDLF/training_loop.py", line 269, in validate_network
output_prediction += output.cpu().data.item()# this probably needs customization for classification (majority voting or median, perhaps?)
ValueError: only one element tensors can be converted to Python scalars
from gandlf.
Can you try pulling from my branch now and re-try?
from gandlf.
Sorry for replying so late! Was busy the last few days.
Sadly the error is still the same with the new refactor pull.
from gandlf.
You can try to reproduce the error from my fork: https://github.com/Karol-G/GaNDLF/tree/refactor
I added the experiment model.yaml, train.csv and the toy dataset.
You should be able to reproduce the error with the following command:
gandalf_run -config ./my_experiments/2d_classification/model_simple.yaml -data ./my_experiments/2d_classification/train.csv -output ./my_experiments/2d_classification/output_dir/ -train 1 -device -1 -reset_prev True
When debugging, I noticed that the model output is of size [1,2,1] which cannot be converted to a scalar with .item().
There is a comment there that "this probably needs customization for classification (majority voting or median, perhaps?)", so I guess that is probably the solution 😄
from gandlf.
Related Issues (20)
- GAN metrics
- Compute utilities for incorporating generative networks
- Add remaining files and functionalities for GANs
- Add unit testing for GANs
- Update GANDLF functionalities for compatibility with GAN pipelines
- AUROC error while running classification of pathology images HOT 3
- [FEATURE] Set `line-length` for `black` in the `project.toml` file HOT 1
- Config documentation for GANs
- Black configuration in pyproject.toml
- [FEATURE] Add the ability to split CSVs for training/validation/testing as a separate script HOT 1
- [FEATURE] Add the ability to generate training/validation/testing CSV with proportional splits HOT 1
- [FEATURE] Add tensorboard support HOT 2
- [FEATURE] speed up CI tests HOT 3
- [BUG] Moving from version `0.0.XX` to `0.Y.0` creates compatibility issues. HOT 2
- [FEATURE] Add a "migration guide" in documentation HOT 2
- [BUG] Trying to train a model for classification gives a weird warning HOT 1
- [FEATURE] Standardize the CLI option for output directory HOT 1
- [BUG] Loss signatures: CE Loss failure because of additional `params` argument HOT 2
- [FEATURE] Upgrade PyTorch to 2.2.1 HOT 2
- [BUG] Noise and Blur enhanced fail for certain images
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 gandlf.