I have GNU Octave 5.2.0, and I want to use it to analyze the IQ data in a wav file. This link describes a function called wavread which I can use in Octave, but when I run y = wavread(filename), I get this error message:
error: 'wavread' undefined near line 1 column 1
Why do I get this? My best guess is that wavread is deprecated for some reason and only exists in earlier versions. My other guess is that I have to install an extension to use wavread, but I didn't find a source that allows me to do this.
As discovered by #TasosPapastylianou, the wavread function is deprecated as of Octave version 5. Solution is to use audioread function.
Related
Question: How can I download an older version of PyTorch geometric in google colab?
Context: I am trying to use/load a pytorch-geometric graph and am getting the error message: "RuntimeError: The 'data' object was created by an older version of PyG. If this error occurred while loading an already existing dataset, remove the 'processed/' directory in the dataset's root folder and try again." This graph was generated during summer 2021.
I am using PyTorch and the following code to import Pytorch geometric, but am still getting the error when using older versions.
#import torch
!pip install torch==1.8.0
import torch
torch.__version__
!pip install torch-scatter torch-sparse torch-cluster torch-spline-conv torch-geometric -f https://data.pyg.org/whl/torch-1.8.0+cpu.html
I am not sure whether I am using the correct older version of pytorch-geometric (I don't really know how to check whether this is correct). Any insight to would be greatly appreciated:
How to download older version of pytorch geometric?
What is causing this error?
Thanks in advance.
You may not need to downgrade: If G is a graph data object giving this error you can simply convert it as follows.
from torch_geometric.data import Data
G = Data(**G.__dict__)
I'm not sure if you still need it but I just ran into the same problem and here's what I found:
It seems like there isn't a compatibility document but you can check the version history here and find the corresponding release for the one nearest to the time when your pytorch version was released, of course this doesn't guarantee compatibility but I think you have a pretty good chance?
For the additional packages e.g. torch-scatter, you can find the corresponding versions here and install from the .whl files.
I wrote a model to solve using dynare in octave. After writing the model, I save it with “.m” format. Then I type “dynare filename” in octave’s command window to run the model but instead the file gets deleted.
Oddly, it doesn’t happen if I use the command on a file with “.mod” format.
I’m using Octave 5.2.0 since the dynare only works with this version.
Please help me if you can. Tnx a lot.
I guess you used Dynare 4.5 instead of the recent stable release 4.6. As documented in the manual, the only supported file-types in Dynare are .mod and .dyn. You cannot name your file .m as Dynare will preprocess your .mod-file and create an m-file with the same name. Usually, you would get an explicit error message. However, in Octave, the following code is executed first:
% Workaround for a strange bug with Octave: if there is any call to exist(fname)
% before the call to the preprocessor, then Octave will use the old copy of
% the .m instead of the newly generated one. Deleting the .m beforehand
% fixes the problem.
if isoctave && length(dir([fname(1:(end-4)) '.m'])) > 0
delete([fname(1:(end-4)) '.m'])
end
Dynare 4.6 instead moved to Matlab-classes. There you will get an explicit error message.
I'm using the current bundled binaries from https://github.com/excelsior-oss/xds (as of 12/6/2020) with just the most basic Hello World MOD file:
MODULE HelloWorld;
FROM STextIO IMPORT WriteLn, WriteString;
BEGIN
WriteString("Hello, World!");
WriteLn;
END HelloWorld.
xc HelloWorld.mod works fine for compiling it to object. However, I'm not clear on the exact syntax for xlink on a standalone MOD file. xlink HelloWorld.obj will at least get it to try with my object file, but as the error shows, it doesn't know the entrypoint. I've tried setting the entry point with the /ENTRY switch, but no luck doing it by module name. I've also tried setting the /SYS to console, but again, no luck there.
I feel there's some trivial linker option or program directive needed, but I'm just not finding it via Google...
To build a binary, use: xc =a =make HelloWorld.mod
The above is found in https://github.com/excelsior-oss/xds/blob/master/Sources/Doc/Comp/src/usage.tex .
It is unfortunate that XDS did not put PDFs of their documentation on github. I suggest building the documentation from their LaTeX files.
Edit: I since learnt that the Wayback Machine has archived the XDS documentation here: https://web.archive.org/web/20060705213825/http://www.excelsior-usa.com/xdsdoc.html
lets say I have a test.m octave script
test.m
x = 1;
A % Syntax error, A isn't defined
so I run the script with
octave test.m
What I'm interested in is how do I get octave to return non-zero exit status if the script contains a syntax error? Note, I am not interested in encapulating the code with if-else statements and do exit(-1). I am interested in a solution that tells octave to return a non-zero value if the script contains syntax errors.
Edit: I was using Octave 4.2 that comes default with Ubuntu 18.04. Commenters have suggested Octave 5+ does not exhibit this behaviour.
Never mind I solved it. To give some context why I needed this behaviour, its because I'm trying to write the octave scripts that basically test octave functions I write.
Now more often than not I will have written scripts that contain syntax errors, and octave will raise errors while parsing the scripts. However, the return status is always 0 if you run your script in a straight forward manner like:
octave script.m
regardless if your octave script contains syntax errors or not. I however did not want to surround every script I write with if-else or try-catches, that is why I opened this question on SO.
A workaround I have found is just to source the script by using the --eval flag. i.e.
octave --eval "source('script.m');"
This way if your script does contain syntax errors the return value / status is a non-zero exit value. In this case I believe octave defaults to 1.
I cannot reproduce the behaviour in your question. In octave 5 at least, doing
octave myscript.m
results in a return value of 1 in case of error.
Same as doing
octave --eval "source('myscript.m')"
So
here is the import lines of my script...when I uncomment the JSON::RPC line I get the error listed below. I'm not even using the library in the script and still get the error listed below
#!/usr/bin/perl -w
use Data::Dumper;
use Mail::MboxParser;
use Mail::MboxParser::Mail;
use Mail::Box::Manager;
use Email::Delete qw[delete_message];
use POSIX;
use Date::Calc qw(:all);
#use JSON::RPC::Client;
use strict;
--
/usr/bin/perl: symbol lookup error: /usr/local/lib64/perl5/auto/Storable/Storable.so: undefined symbol: Perl_Istack_sp_ptr
On the perl 5.10 box:
perl -MStorable -wle'print $ARGV[0]->VERSION' Storable
2.30
On the perl 5.16 box:
perl -MStorable -wle'print $ARGV[0]->VERSION' Storable
perl: symbol lookup error: /usr/local/lib64/perl5/auto/Storable/Storable.so: undefined symbol: Perl_Istack_sp_ptr
(I can't find a module called JSON::RPC::Client on CPAN, so some of this is guesswork. Where did the module come from?)
The reason why you're getting those errors when you just uncomment the use line is that Perl will then try to load the library. And the load is failing.
It looks like your library has an XS component. That is to say, it's not written in Pure Perl. Part of it is a Perl wrapper around a library written in another language (probably C).
Perl guarantees that XS libraries written for a given major version of Perl (in this case 5.10) will work for all minor releases under that same major version number (so any 5.10.x). But major releases will usually break that binary compatibility. An XS module built for Perl 5.10.x will not usually work with Perl 5.16.x.
The solution is to rebuild the module for your new version of Perl. I hope you know where the source code is, because (as I mentioned earlier) it's not on CPAN.