help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: save and load bug.


From: Ben Abbott
Subject: Re: save and load bug.
Date: Thu, 25 Dec 2008 20:46:59 -0500


On Dec 24, 2008, at 11:55 PM, GARY FORBIS wrote:

OK, it's been awhile since I've tried GNU Octave. I'm running vista with octave-3.0.3. It's much better than 3.0.1. I'm back to learning the language by running an existing program. It did a save in several places then loaded the files back in later. Unfortunately they didn't load.

I used this unix command to help me track down the problem:

$ head -n 6 mnistvhclassify| cut -d\ -f-1000 >garytest2;tail -n 1 garytest2 | wc
      1     500   10420

and modified the number of rows and columns until it quit failing.

This one worked:
$ head -n 6 garytest2| cut -d\ -f-190 >garytest1;tail -n 1 garytest1 | wc
      1     189    3943

This one failed:
$ head -n 6 garytest2| cut -d\ -f-191 >garytest1;tail -n 1 garytest1 | wc
      1     190    3964

There's nothing interesting about the number of characters near these numbers so I wrotethis:

 a=0.0877672686001518
 b=[]
 for x=1:500
 b=[b,a]
 save stest b
 load stest
 end

and it worked all the way thru.

$ tail -n 1 stest | wc
      1     500    9502

so I took the last value in the file that failed, -0.03597396637549816, and reran the program and it fail with this size:

$ tail -n 1 stest | wc
      1     384    8066

The problem appears to have nothing to do with the number of characters in the row.
Then I counted the number of negative number:

$ tail -n 1 garytest1 | sed 's/[^-]//g' | wc
      1       1     191

but that's only half of the place where the simple program failed.
I don't get it.

Any ideas?

Thanks.

I tried a simple version

        a = -rand (1, 500);
        save -text test.txt a
        clear all
        load test.txt
        whos a

Running both 3.0.3 and the developers sources load() appears to work.

I you are unable to produce a simple example which demonstrates the problem, can you attach a file that doesn't load so that it may be examined?

Ben




reply via email to

[Prev in Thread] Current Thread [Next in Thread]