elgiano / nn.ar

nn_tilde adaptation for SuperCollider
GNU General Public License v3.0
30 stars 4 forks source link

error when rebooting server #9

Closed victor-shepardson closed 5 months ago

victor-shepardson commented 6 months ago

It looks like NN.ar registers doOnServerBoot actions to re-load any models when you reboot the server -- but I think infoFile winds up being nil when the server boots again:

ERROR: Message 'standardizePath' not understood.
RECEIVER:
   nil
ARGS:

PROTECTED CALL STACK:
    Meta_MethodError:new    0x13830d900
        arg this = DoesNotUnderstandError
        arg what = nil
        arg receiver = nil
    Meta_DoesNotUnderstandError:new 0x13830fbc0
        arg this = DoesNotUnderstandError
        arg receiver = nil
        arg selector = standardizePath
        arg args = [  ]
    Object:doesNotUnderstand    0x14832af80
        arg this = nil
        arg selector = standardizePath
        arg args = nil
    Meta_NN:loadMsg 0x139152540
        arg this = NN
        arg id = 0
        arg path = /Users/victor/living-looper/ll_test_l4_z26.ts
        arg infoFile = nil
    NNModel:doOnServerBoot  0x1383b9980
        arg this = NNModel(test, 2048)
    ArrayedCollection:do    0x1393807c0
        arg this = [ a Function, NNModel(test, 2048) ]
        arg function = a Function
        var i = 1
    List:do 0x139439080
        arg this = List[ a Function, NNModel(test, 2048) ]
        arg function = a Function
    Meta_AbstractServerAction:performFunction   0x138fec340
        arg this = ServerBoot
        arg server = localhost
        arg function = a Function
    Meta_AbstractServerAction:run   0x138fec880
        arg this = ServerBoot
        arg server = localhost
        var selector = doOnServerBoot
    a FunctionDef   0x139635b80
        sourceCode = "<an open Function>"
    Routine:prStart 0x138eb5140
        arg this = a Routine
        arg inval = 68511.159058917

CALL STACK:
    DoesNotUnderstandError:reportError
        arg this = <instance of DoesNotUnderstandError>
    < closed FunctionDef >
        arg error = <instance of DoesNotUnderstandError>
    Integer:forBy
        arg this = 0
        arg endval = 0
        arg stepval = 2
        arg function = <instance of Function>
        var i = 0
        var j = 0
    SequenceableCollection:pairsDo
        arg this = [*2]
        arg function = <instance of Function>
    Scheduler:seconds_
        arg this = <instance of Scheduler>
        arg newSeconds = 68511.159133792
    Meta_AppClock:tick
        arg this = <instance of Meta_AppClock>
        var saveClock = <instance of Meta_SystemClock>
    Process:tick
        arg this = <instance of Main>
^^ ERROR: Message 'standardizePath' not understood.
RECEIVER: nil

possibly this logic: https://github.com/elgiano/nn.ar/blob/eb36a3a345393c810f97ffc62e7e1fecdfbf4eed/plugins/NNModel/sc/NNModel.sc#L41-L44 should be repeated in NNModel.loadMsg or moved into NN.loadMsg?

elgiano commented 6 months ago

thanks @victor-shepardson In https://github.com/elgiano/nn.ar/commit/d6ffd70bb78b2bc79ac2ebafd519cadabc6ca53e I removed model auto-reload on ServerBoot and added a model.reload function. Actually adding server hooks had high risk of polluting the environment, with hooks accumulating on every reboot. It's still fairly easy to reload all models and I'll leave it to the user:

NN.models.do(_.reload)