Giter VIP home page Giter VIP logo

Comments (7)

Karol-G avatar Karol-G commented on August 25, 2024 1

Yes! It is working now 😁 Thanks!

from gandlf.

sarthakpati avatar sarthakpati commented on August 25, 2024

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.

sarthakpati avatar sarthakpati commented on August 25, 2024

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.

Karol-G avatar Karol-G commented on August 25, 2024

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.

sarthakpati avatar sarthakpati commented on August 25, 2024

Can you try pulling from my branch now and re-try?

from gandlf.

Karol-G avatar Karol-G commented on August 25, 2024

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.

Karol-G avatar Karol-G commented on August 25, 2024

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)

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.