retape error

219 views
Skip to first unread message

jefflaake

unread,
Feb 28, 2017, 3:15:47 PM2/28/17
to TMB Users
Can anyone give me guidance on what to look for with regards to the following error from MakeADFun

Error in retape() : 
  Error when reading the variable: 'TMB_epsilon_'. Please check data and parameters.
In addition: Warning message:
In retape() : Expected object. Got NULL.


It says to check data and parameters but I don't have a variable TMB_epsilon_ so not sure what to look for.  With different models, MakeADFun does run successfully. The model changes the design matrices describing the model which are part of the input data. I looked at the data list and parameter list passed to MakeADFun but there is nothing that stands out as being different and it all looked fine. Is it because there is a disagreement of types? I searched for parts of this error on the wiki and internet but came up empty. I also debugged into MakeADFun and retape but ran into the generic error message in which TMB_epsilon was a value of a variable in the message but it didn't help me work out the problem.

I realize this may not give enough info to work out what is wrong but any direction would be appreciated.

regards --jeff

jefflaake

unread,
Feb 28, 2017, 3:52:27 PM2/28/17
to TMB Users
Never mind.  I fell back to old-fashion debug approach of throwing out code and found the offending piece of code. Nothing to do with data and parameters. I was using an int variable index that was not declared in the code.  I had moved this code into the objective function from a separate function and in doing so forgot to copy over the declaration for index.  I thought this should have been a compile time error but apparently not. I'm "learning" more c++ one mistake at a time. I'm not certain why it ran for any model but it did.

--jeff

Kasper Kristensen

unread,
Feb 28, 2017, 4:44:33 PM2/28/17
to jefflaake, TMB Users
Seems you have encountered an unfortunate name collision. There's an integer variable 'index' declared in the objective_function class. That's why you didn't get a compilation error. Your program was actually using this internal index variable which led to the strange 'TMB_epsilon' error.


From: tmb-...@googlegroups.com [tmb-...@googlegroups.com] on behalf of jefflaake [jeff...@gmail.com]
Sent: Tuesday, February 28, 2017 9:52 PM
To: TMB Users
Subject: [TMB users] Re: retape error

--
To post to this group, send email to us...@tmb-project.org. Before posting, please check the wiki and issuetracker at https://github.com/kaskr/adcomp/. Please try to create a simple repeatable example to go with your question (e.g issues 154, 134, 51). Use the issuetracker to report bugs.
---
You received this message because you are subscribed to the Google Groups "TMB Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tmb-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tmb-users/647308c6-c010-49de-bad4-3f3ca94e2c3a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Message has been deleted

bolis...@gmail.com

unread,
Feb 16, 2021, 9:43:35 AM2/16/21
to TMB Users
For anyone else: I most frequently encounter this error when I have listed a parameter in MakeADFun that is not used within the C++ code.

Kinh Nguyen

unread,
Mar 18, 2022, 1:36:07 PM3/18/22
to TMB Users
Another reason is you made some changes (add/rename/...) in the data/parameters and the DLL failed to unload even you did recompile and reload the model, restart the R session fixed this for me.
Reply all
Reply to author
Forward
0 new messages