Git Product home page Git Product logo

respirenet's Issues

TypeError: 'float' object cannot be interpreted as an integer

Hello , @sidgairo18 :

Very appreciate your works for controbuting the AI Medical.

I have a little question about the input arguments  

parser.add_argument('--aug_scale', default=None, type=float, help='Augmentation multiplier') the aug_scale type was set to float,
However when I add the --aug_scale 1 in the command,
i got the following problems:

Traceback (most recent call last): 
File "/home/RespireNet_lab/train.py", line 316, in <module> trainer = Trainer() 
File "/home/RespireNet_lab/train.py", line 124, in __init__ True, 
"params_json", self.input_transform, stetho_id=self.args.stetho_id, aug_scale=self.args.aug_scale) 

File "/home/RespireNet_lab/image_dataloader.py", line 95, in __init__ 
self.new_augment(scale=aug_scale) 
File "/home/RespireNet_lab/image_dataloader.py", line 130, 
in new_augment for idx in range(aug_nos):

TypeError: 'float' object cannot be interpreted as an integer

and  If I set   the  type to int : parser.add_argument('--aug_scale', default=None, type=int, help='Augmentation multiplier')

it will appear the  following  problems:

get individual cycles from each audio file:: 100%|██████████| 722/722 [11:40<00:00,  1.03it/s]
Traceback (most recent call last):  
File "/home/RespireNet_lab/train.py", line 316, in <module>    trainer = Trainer()  
File "/home/RespireNet_lab/train.py", line 124, in __init__    
True, "params_json", self.input_transform, stetho_id=self.args.stetho_id, aug_scale=self.args.aug_scale) 

 File "/home/RespireNet_lab/image_dataloader.py", line 111, in __init__    
  self.device_wise[self.file_to_device[sample[2]]].append(sample)

KeyError: '203_1p2_Ar_mc_AKGC417L-203_1p4_Ar_mc_AKGC417L'

could you tell us how to start up this data aug function? 
thanks in advance.

check out the acc, and Score

Hello, author:
I think you let acc = Score, in your valid stage code, you let :

  `acc = accuracy_score(y_true, y_pred)`

however, the official scocre defination : score = (sp + se)/2 which you use it in the training stage but in the valid stage you use acc instead.

Can you check it out, thanks a lot.

Data format error

Hi, I ran your code and it reported an error as follows

Original Traceback (most recent call last):
File "/home/sata/zsb/miniconda/lib/python3.9/site-packages/torch/utils/data/_u tils/worker.py", line 287, in _worker_loop
data = fetcher.fetch(index)
File "/home/sata/zsb/miniconda/lib/python3.9/site-packages/torch/utils/data/_u tils/fetch.py", line 49, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/sata/zsb/miniconda/lib/python3.9/site-packages/torch/utils/data/_u tils/fetch.py", line 49, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/zsb/LHT2/Feiyin/image_dataloader.py", line 248, in getitem
audio = split_and_pad([audio, 0,0,0,0], self.desired_length, self.sample_rat e, types=1)[0][0]
File "/home/zsb/LHT2/Feiyin/utils.py", line 120, in split_and_pad
padded = generate_padded_samples(soundclip, soundclip, output_buffer_length, sample_rate, types); pad_times = (output_buffer_length-len(soundclip))/len(soun dclip)
File "/home/zsb/LHT2/Feiyin/utils.py", line 176, in generate_padded_samples
copy[:src_length] = source[:]
ValueError: setting an array element with a sequence. The requested array would exceed the maximum number of dimension of 1.

I really want to know why this error emerges, thank u!

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.