Comments (3)
Copying my reply from the forum:
https://forum.vocalpy.org/t/vak-tweetynet-with-an-apple-m1-max/78/11?u=nicholdav
I think the problem isn't the way we save the arrays for the dataset. I confirmed this shouldn't be an issue but I'll spare you the details (basically, we transform inputs to float32 when we load them).
(I first thought it was because we were loading spectrograms as float64, but in fact we apply a transform to make them float32)
My best guess is that the error happens when lightning tries to take a computed metric value that is returned and put it in a tensor, in order to log that value. Because the returned value is
float64
, we get this error.From the traceback you provided, we see where we're calling
self.log
:File "/opt/anaconda3/envs/TweetyNet/lib/python3.11/site-packages/vak/models/windowed_frame_classification_model.py", line 208, in validation_step self.log(f'val_{metric_name}', metric_callable(y_pred_labels, y_labels), batch_size=1)
Here's line 208 in version 1.0.0a1 that you're using:
https://github.com/vocalpy/vak/blob/3dcce70030ae9b1fd6d040e055def0d656a7512e/src/vak/models/windowed_frame_classification_model.py#L208You can see that we're computing an edit distance metric using string labels. So it can't be the tensor inputs to the model, and it has to be the returned value. I put in a
breakpoint()
before that line and ran aneval
file to confirm that, yes, thesegment_edit_distance
returns a numpy float with dtypefloat64
. I'm guessing that's what causes the crash.I think I have a fix here:
https://github.com/vocalpy/vak/tree/make-distance-metrics-return-tensors
I will raise a separate issue stating we need all metrics to return tensors, apply the fix I have in progress in that branch, and then release a new version
from vak.
@all-contributors please add @VenetianRed for bug
from vak.
I've put up a pull request to add @VenetianRed! 🎉
from vak.
Related Issues (20)
- ENH: Add config / params dataclasses for high-level functions HOT 1
- CLN: Catch audio channels > 1 in prep.frame_classification and raise a clear error
- DOC: Add Yang Carstens Provost 2023 + Koparkar et al 2023 to pubs section of about page HOT 1
- ENH: Add ability to specify function/callable to make spectrogram during prep step
- DEV/ENH: Switch to using tomlkit
- DOC: Better document spectrogram options, e.g. with a how-to + link to API + reference docs
- BUG: Running vak 1.0.0a1 with device set to CPU crashes HOT 6
- Finish Parametric UMAP model + add datasets
- ENH: Refer to 'accelerator' not 'device'
- TST/CLN: Further clean up / refactor how we generate test data
- DOC/CLN: revise/fix API docs for 1.0.0
- Inconsistent syllable error rate between vak eval and predict HOT 15
- BUG/MAINT: Have all metrics return tensors HOT 1
- DOC: Make minor doc fixes
- ENH: Require that `metrics` for a model definition be a subclass of `torchmetrics.Metric` HOT 3
- BUG: Getting a warning about Nvidia Tensor Cores HOT 1
- BUG: Getting a warning about missing logger directories HOT 2
- ENH: Have `vak.predict` accept `post_tfm_kwargs` like `eval` + `learncurve`
- ENH: Minimize duplication of data when preparing datasets for frame classification models 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 vak.