Comments (5)
Hi! thank you!
The evaluate_only
command get the validation dataset here, you can edit this line to load any dataloader
val_loader = get_my_loader()
If you want to validate on another dataset, you can create for exmaple a custom loader (like this one )
get_my_loader = ex.datasets.eval.iter(DataLoader, static_args=dict(worker_init_fn=worker_init_fn),
validate=False, batch_size=10, num_workers=16,
dataset=CMD("/basedataset.get_my_eval_set"))
you need however to define the function that gets the dataset /basedataset.get_my_eval_set
which can be similar to this
@dataset.command
def get_my_baseeval_set(my_eval_hdf5="path_to_my_hdf.hdf", variable_eval=None):
if variable_eval:
print("Variable length eval!!")
ds = AudioSetDataset(my_eval_hdf5, clip_length=None)
else:
ds = AudioSetDataset(my_eval_hdf5)
return ds
@dataset.command
def get_my_eval_set(normalize):
ds = get_my_baseeval_set()
if normalize:
print("normalized test!")
fill_norms()
ds = PreprocessDataset(ds, norm_func)
return ds
from passt.
First off; thank you a lot for answering! Second; forgive me, I made a silly mistake and wrote the wrong command in my earlier post. The command I used was
python ex_fsd50k.py with passt_s_swa_p16_s16_128_ap473
and it makes use of the evaluation dataset for validation, which confuses me. I found this by changing the dataset length as described earlier. Is there something I'm misunderstanding?
from passt.
Hi! yes the default behaviour is that the model is evaluated on both datasets.
You can change that here by setting validate=False
or adding datasets.eval.validate=False
to your command:
python ex_fsd50k.py with passt_s_swa_p16_s16_128_ap473 datasets.eval.validate=False
from passt.
Hi again. When I try to run the program as described above, I get this error:
ERROR - fsd50k - Failed after 0:03:31!
Traceback (most recent calls WITHOUT Sacred internals):
File "ex_fsd50k.py", line 391, in evaluate_only
res = trainer.validate(modul, val_dataloaders=val_loader)
File "/home/ludvigj/Desktop/PaSST/src/pytorch-lightning/pytorch_lightning/trainer/trainer.py", line 883, in validate
results = self.fit(model)
File "/home/ludvigj/Desktop/PaSST/src/pytorch-lightning/pytorch_lightning/trainer/trainer.py", line 474, in fit
self.dispatch()
File "/home/ludvigj/Desktop/PaSST/src/pytorch-lightning/pytorch_lightning/trainer/trainer.py", line 513, in dispatch
self.accelerator.start_evaluating(self)
File "/home/ludvigj/Desktop/PaSST/src/pytorch-lightning/pytorch_lightning/accelerators/accelerator.py", line 95, in start_evaluating
self.training_type_plugin.start_evaluating(trainer)
File "/home/ludvigj/Desktop/PaSST/src/pytorch-lightning/pytorch_lightning/plugins/training_type/training_type_plugin.py", line 139, in start_evaluating
self._results = trainer.run_evaluate()
File "/home/ludvigj/Desktop/PaSST/src/pytorch-lightning/pytorch_lightning/trainer/trainer.py", line 745, in run_evaluate
eval_loop_results, _ = self.run_evaluation()
File "/home/ludvigj/Desktop/PaSST/src/pytorch-lightning/pytorch_lightning/trainer/trainer.py", line 700, in run_evaluation
deprecated_eval_results = self.evaluation_loop.evaluation_epoch_end()
File "/home/ludvigj/Desktop/PaSST/src/pytorch-lightning/pytorch_lightning/trainer/evaluation_loop.py", line 187, in evaluation_epoch_end
deprecated_results = self.__run_eval_epoch_end(self.num_dataloaders)
File "/home/ludvigj/Desktop/PaSST/src/pytorch-lightning/pytorch_lightning/trainer/evaluation_loop.py", line 222, in __run_eval_epoch_end
eval_results = model.validation_epoch_end(eval_results)
File "ex_fsd50k.py", line 216, in validation_epoch_end
avg_loss = torch.stack([x[net_name + 'val_loss'] for x in one_outputs]).mean()
File "ex_fsd50k.py", line 216, in <listcomp>
avg_loss = torch.stack([x[net_name + 'val_loss'] for x in one_outputs]).mean()
TypeError: string indices must be integers
I've spent quite some time trying to make it work but can't get it right. There seems to be some trouble in validation_epoch_end
. You don't happen to know what needs to be changed?
from passt.
I think I've got it working now by copying the code for validation_epoch_end
from ex_audioset.py
, so everything should be settled now!
from passt.
Related Issues (20)
- Inference ESC-50 fine-tuned model HOT 2
- kaggle HOT 2
- Fine tuning on novel dataset HOT 4
- Is it possible to use this project directly for a code example for instrument recognition? HOT 4
- mismatch version of pytorch-lighting and sarced HOT 15
- Installation issues HOT 1
- The loop in the diagram HOT 1
- RuntimeError: The size of tensor a (2055) must match the size of tensor b (99) at non-singleton dimension 3 HOT 3
- is `config.dyn_norm` enabled? HOT 1
- Is it possible to install the passt with python=3.6? HOT 2
- ImportError: cannot import name 'F1' from 'torchmetrics' (/app/anaconda3/lib/python3.7/site-packages/torchmetrics/__init__.py) HOT 1
- Pretrained models config HOT 3
- OpenMic fine-tuned model? HOT 2
- Could not solve for environment specs HOT 4
- setup.py
- I have a problem. why convert wav to mp3? HOT 3
- difference of fine-tuning the pretrained models HOT 2
- Inference Issue HOT 2
- Getting started with a custom dataset HOT 8
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 passt.