<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Missed Call to write output]]></title><description><![CDATA[<p dir="auto">Re: <a href="/community/topic/411/error-q20-output-missing-when-submitting">Error Q20 output missing when submitting</a></p>
<p dir="auto">Hi I encountered a similar issue and found this post. In my case I get Missed call to write_output when submitting the strategy, however not when I backtest the strategy locally (I used fewer assets locally due to time constraint, while backtesting locally). My strategy number is: # 16526387. would be kind if you can have a look</p>
]]></description><link>http://quantiacs.com/community/topic/522/missed-call-to-write-output</link><generator>RSS for Node</generator><lastBuildDate>Fri, 15 May 2026 05:33:12 GMT</lastBuildDate><atom:link href="http://quantiacs.com/community/topic/522.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 18 Feb 2024 14:56:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Missed Call to write output on Sat, 06 Apr 2024 01:27:27 GMT]]></title><description><![CDATA[<p dir="auto">I finally resolved the issue, after lots of struggle. The custom layers, custom loss function and the function had to be serialized and deserialized correctly in order to save the architecture and weights as Json, rather than in a dictionary, like is suggested for pytorch in the Neural netowork template.<br />
It seems Pytorch is way more user friendly when it comes to saving and loading models.</p>
]]></description><link>http://quantiacs.com/community/post/1552</link><guid isPermaLink="true">http://quantiacs.com/community/post/1552</guid><dc:creator><![CDATA[magenta.kabuto]]></dc:creator><pubDate>Sat, 06 Apr 2024 01:27:27 GMT</pubDate></item><item><title><![CDATA[Reply to Missed Call to write output on Thu, 04 Apr 2024 23:33:40 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="http://quantiacs.com/community/uid/5">@vyacheslav_b</a>,<br />
I implemented your suggestion in my local environment and this is the result:<br />
fetched chunk 1/1 3s<br />
Data loaded 3s<br />
Output cleaning...<br />
fix uniq<br />
ffill if the current price is None...<br />
Check liquidity...<br />
Ok.<br />
Check missed dates...<br />
Ok.<br />
Normalization...<br />
Output cleaning is complete.<br />
NOTICE: The environment variable OUTPUT_PATH was not specified. The default value is 'fractions.nc.gz'<br />
Write output: fractions.nc.gz<br />
NOTICE: The environment variable OUT_STATE_PATH was not specified. The default value is 'state.out.pickle.gz'<br />
state<br />
(numpy.datetime64('2024-04-02T00:00:00.000000000'), {'arch': &lt;<strong>main</strong>.LSTM_Encoder object at 0x7fc4be530bb0&gt;}, None)<br />
State saved.</p>
<p dir="auto">I dont know why the date is 2024-04-02, however the second part is the model and the state is None, and as the error is : File ~/book/qnt/state.py:12, in write(state)<br />
10 path = get_env("OUT_STATE_PATH", "state.out.pickle.gz")<br />
11 with gzip.open(path, 'wb') as gz:<br />
---&gt; 12     pickle.dump(state, gz)<br />
13     log_info("State saved.")</p>
<p dir="auto">AttributeError: Can't pickle local object 'Layer._initializer_tracker.&lt;locals&gt;.&lt;lambda&gt;' , the error occurs while dumping the state, which is none, the error message is unclear to me,besides pickle being unable to dump this object.ChatGPT suggests using dill instead of pickle. Do you maybe know more? Thx a lot. Regards</p>
]]></description><link>http://quantiacs.com/community/post/1541</link><guid isPermaLink="true">http://quantiacs.com/community/post/1541</guid><dc:creator><![CDATA[magenta.kabuto]]></dc:creator><pubDate>Thu, 04 Apr 2024 23:33:40 GMT</pubDate></item><item><title><![CDATA[Reply to Missed Call to write output on Tue, 26 Mar 2024 20:02:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://quantiacs.com/community/uid/5">@vyacheslav_b</a> oh I see. Thx a lot for the solution. I will try it out later <img src="http://quantiacs.com/community/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=o92lv7m3jt8" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" title=":)" alt="🙂" /></p>
]]></description><link>http://quantiacs.com/community/post/1509</link><guid isPermaLink="true">http://quantiacs.com/community/post/1509</guid><dc:creator><![CDATA[magenta.kabuto]]></dc:creator><pubDate>Tue, 26 Mar 2024 20:02:54 GMT</pubDate></item><item><title><![CDATA[Reply to Missed Call to write output on Tue, 26 Mar 2024 16:27:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://quantiacs.com/community/uid/1799">@magenta-kabuto</a> Hello. I meant that you can modify the code in the file ~/book/qnt/state.py and see what gets saved there.</p>
<p dir="auto">It was:</p>
<pre><code class="language-python">import gzip, pickle

from qnt.data import get_env
from qnt.log import log_err, log_info

def write(state):
    if state is None:
        return
    path = get_env("OUT_STATE_PATH", "state.out.pickle.gz")
    with gzip.open(path, 'wb') as gz:
        pickle.dump(state, gz)
        log_info("State saved.")

def read(path=None):
    if path is None:
        path = get_env("IN_STATE_PATH", "state.in.pickle.gz")
    try:
        with gzip.open(path, 'rb') as gz:
            res = pickle.load(gz)
            log_info("State loaded.")
            return res
    except Exception as e:
        log_err("Can't load state.", e)
        return None

</code></pre>
<p dir="auto">It became:</p>
<pre><code class="language-python">import gzip, pickle

from qnt.data import get_env
from qnt.log import log_err, log_info

def write(state):
    if state is None:
        return
    print("state")
    print(state)
    path = get_env("OUT_STATE_PATH", "state.out.pickle.gz")
    with gzip.open(path, 'wb') as gz:
        pickle.dump(state, gz)
        log_info("State saved.")

def read(path=None):
    if path is None:
        path = get_env("IN_STATE_PATH", "state.in.pickle.gz")
    try:
        with gzip.open(path, 'rb') as gz:
            res = pickle.load(gz)
            log_info("State loaded.")
            return res
    except Exception as e:
        log_err("Can't load state.", e)
        return None

</code></pre>
<p dir="auto">Save the file and restart the kernel.</p>
]]></description><link>http://quantiacs.com/community/post/1507</link><guid isPermaLink="true">http://quantiacs.com/community/post/1507</guid><dc:creator><![CDATA[Vyacheslav_B]]></dc:creator><pubDate>Tue, 26 Mar 2024 16:27:23 GMT</pubDate></item><item><title><![CDATA[Reply to Missed Call to write output on Tue, 19 Mar 2024 12:03:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://quantiacs.com/community/uid/5">@vyacheslav_b</a> hmm..The state is saved by the backtester, it is not something I configured. I guess it is related to the retraining of the model but I am not sure.Regarding lambda, I only used lambda once in the entire notebook and it was unrelated to the layers of the neural network, however I removed it and strangely since morning I am for the same code, that worked yesterday encountering the following error in the online environment (using only 1 epoch,whereas yesterday I used upto 10 epochs,which should be more expensive): 2024-03-19 11:55:08.657960: W external/local_tsl/tsl/framework/cpu_allocator_impl.cc:83] Allocation of 10035200000 exceeds 10% of free system memory, so that I am not possible to check whether the error dissapeared.<br />
I am sorry to bother you with this but its getting really confusing <img src="http://quantiacs.com/community/plugins/nodebb-plugin-emoji/emoji/android/1f62c.png?v=o92lv7m3jt8" class="not-responsive emoji emoji-android emoji--grimacing" title=":grimacing:" alt="😬" /><br />
Regards</p>
]]></description><link>http://quantiacs.com/community/post/1481</link><guid isPermaLink="true">http://quantiacs.com/community/post/1481</guid><dc:creator><![CDATA[magenta.kabuto]]></dc:creator><pubDate>Tue, 19 Mar 2024 12:03:28 GMT</pubDate></item><item><title><![CDATA[Reply to Missed Call to write output on Tue, 19 Mar 2024 11:10:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://quantiacs.com/community/uid/1799">@magenta-kabuto</a> append</p>
<pre><code class="language-python">print(state)
</code></pre>
<p dir="auto">before saving it. What are you trying to save?</p>
<p dir="auto">you may need to restart the kernel.</p>
<p dir="auto">Answer ChatGPT:</p>
<p dir="auto">The error message you're encountering, AttributeError: Can't pickle local object 'Layer._initializer_tracker.&lt;locals&gt;.&lt;lambda&gt;', indicates that the pickle module is unable to serialize a lambda function (or possibly another local object) that is part of the object state you're attempting to dump to a file. This is a common limitation of pickle, as it cannot serialize lambda functions, local functions, classes defined within functions, or instances of such classes, among other things.</p>
<p dir="auto">Avoid Using Lambda Functions in Serializable Objects<br />
If possible, replace lambda functions with defined functions (even if they're one-liners). Defined functions can be pickled because they are not considered local objects. For example, if you have:</p>
<pre><code class="language-python">lambda x: x + 1
</code></pre>
<p dir="auto">Replace it with:</p>
<pre><code class="language-python">def increment(x):
    return x + 1
</code></pre>
]]></description><link>http://quantiacs.com/community/post/1480</link><guid isPermaLink="true">http://quantiacs.com/community/post/1480</guid><dc:creator><![CDATA[Vyacheslav_B]]></dc:creator><pubDate>Tue, 19 Mar 2024 11:10:58 GMT</pubDate></item><item><title><![CDATA[Reply to Missed Call to write output on Tue, 19 Mar 2024 10:33:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://quantiacs.com/community/uid/5">@vyacheslav_b</a> said in <a href="/community/post/1478">Missed Call to write output</a>:</p>
<blockquote>
<p dir="auto">import sys<br />
import platform</p>
<p dir="auto">print("Python version (simple):", sys.version)<br />
print("Python version (detailed):", platform.python_version())</p>
</blockquote>
<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="http://quantiacs.com/community/uid/5">@Vyacheslav_B</a>  thx a lot for your suggestion. The versions are the same (3.10.13), so unfortunately that isnt the reason for the error.<br />
regards</p>
]]></description><link>http://quantiacs.com/community/post/1479</link><guid isPermaLink="true">http://quantiacs.com/community/post/1479</guid><dc:creator><![CDATA[magenta.kabuto]]></dc:creator><pubDate>Tue, 19 Mar 2024 10:33:03 GMT</pubDate></item><item><title><![CDATA[Reply to Missed Call to write output on Tue, 19 Mar 2024 09:37:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://quantiacs.com/community/uid/1799">@magenta-kabuto</a> Hello. Check the version of Python in your local environment. The problem might be due to incompatibility of the pickle module across different Python versions.</p>
<pre><code class="language-python">import sys
import platform

print("Python version (simple):", sys.version)
print("Python version (detailed):", platform.python_version())
</code></pre>
<p dir="auto"><img src="/community/assets/uploads/files/1710841039078-8b566eb6-4851-42e9-a46e-f225b60d37cf-image.png" alt="8b566eb6-4851-42e9-a46e-f225b60d37cf-image.png" class="img-responsive img-markdown" /></p>
]]></description><link>http://quantiacs.com/community/post/1478</link><guid isPermaLink="true">http://quantiacs.com/community/post/1478</guid><dc:creator><![CDATA[Vyacheslav_B]]></dc:creator><pubDate>Tue, 19 Mar 2024 09:37:57 GMT</pubDate></item><item><title><![CDATA[Reply to Missed Call to write output on Mon, 18 Mar 2024 21:38:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://quantiacs.com/community/uid/12">@support</a> I couldnt find any local dependency and thought the problem may be that the model in the train model is not outputted as a dictionary and cannot be pickled,but this doesnt seem to be the case. Can you work with this information?<br />
Regards</p>
]]></description><link>http://quantiacs.com/community/post/1477</link><guid isPermaLink="true">http://quantiacs.com/community/post/1477</guid><dc:creator><![CDATA[magenta.kabuto]]></dc:creator><pubDate>Mon, 18 Mar 2024 21:38:39 GMT</pubDate></item><item><title><![CDATA[Reply to Missed Call to write output on Mon, 18 Mar 2024 10:37:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://quantiacs.com/community/uid/12">@support</a> thx for the reply. I ran the strategy, for which I get the mentioned error in the online environment and get the following error :---------------------------------------------------------------------------<br />
AttributeError                            Traceback (most recent call last)<br />
Cell In[54], line 1<br />
----&gt; 1 weights = qnbk.backtest_ml(<br />
2     train=train_model,<br />
3     predict=predict,<br />
4     train_period=365*5,   # the data length for training in calendar days<br />
5     retrain_interval=125,  # how often we have to retrain models (calendar days)<br />
6     retrain_interval_after_submit=125, # how often retrain models after submission during evaluation (calendar days)<br />
7     predict_each_day=True,  # Is it necessary to call prediction for every day during backtesting?<br />
8                              # Set it to true if you suspect that get_features is looking forward.<br />
9     competition_type='stocks_nasdaq100',  # competition type<br />
10     lookback_period=375,      # how many calendar days are needed by the predict function to generate the output<br />
11     start_date='2006-01-01',  # backtest start date<br />
12     build_plots=False          # do you need the chart?<br />
13 )</p>
<p dir="auto">File ~/book/qnt/backtester.py:119, in backtest_ml(train, predict, train_period, retrain_interval, predict_each_day, retrain_interval_after_submit, competition_type, load_data, lookback_period, test_period, start_date, end_date, window, analyze, build_plots, collect_all_states)<br />
116 qnout.write(result)<br />
118 if need_retrain and retrain_interval_cur &gt; 1 or state is not None:<br />
--&gt; 119     qnstate.write((created, model, state))<br />
121 if is_submitted():<br />
122     if state is not None:</p>
<p dir="auto">File ~/book/qnt/state.py:12, in write(state)<br />
10 path = get_env("OUT_STATE_PATH", "state.out.pickle.gz")<br />
11 with gzip.open(path, 'wb') as gz:<br />
---&gt; 12     pickle.dump(state, gz)<br />
13     log_info("State saved.")</p>
<p dir="auto">AttributeError: Can't pickle local object 'Layer._initializer_tracker.&lt;locals&gt;.&lt;lambda&gt;' unfortunately I dont get what is meant by that exactly. Thx a lot. Regards</p>
]]></description><link>http://quantiacs.com/community/post/1470</link><guid isPermaLink="true">http://quantiacs.com/community/post/1470</guid><dc:creator><![CDATA[magenta.kabuto]]></dc:creator><pubDate>Mon, 18 Mar 2024 10:37:53 GMT</pubDate></item><item><title><![CDATA[Reply to Missed Call to write output on Sun, 10 Mar 2024 15:04:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://quantiacs.com/community/uid/1799">@magenta-kabuto</a> Hi, sorry for delay, we need more input.</p>
]]></description><link>http://quantiacs.com/community/post/1451</link><guid isPermaLink="true">http://quantiacs.com/community/post/1451</guid><dc:creator><![CDATA[support]]></dc:creator><pubDate>Sun, 10 Mar 2024 15:04:09 GMT</pubDate></item><item><title><![CDATA[Reply to Missed Call to write output on Tue, 20 Feb 2024 11:55:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://quantiacs.com/community/uid/1799">@magenta-kabuto</a> "strategy.ipynb" does not compile. Can this error be thought of as a runtime error? Because I am currently encountering it. Thx in advance</p>
]]></description><link>http://quantiacs.com/community/post/1420</link><guid isPermaLink="true">http://quantiacs.com/community/post/1420</guid><dc:creator><![CDATA[magenta.kabuto]]></dc:creator><pubDate>Tue, 20 Feb 2024 11:55:42 GMT</pubDate></item><item><title><![CDATA[Reply to Missed Call to write output on Mon, 19 Feb 2024 11:02:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://quantiacs.com/community/uid/5">@vyacheslav_b</a> Thx for your answer. You are right, it seems to have been a local dependency I forgot to comment out.</p>
]]></description><link>http://quantiacs.com/community/post/1417</link><guid isPermaLink="true">http://quantiacs.com/community/post/1417</guid><dc:creator><![CDATA[magenta.kabuto]]></dc:creator><pubDate>Mon, 19 Feb 2024 11:02:17 GMT</pubDate></item><item><title><![CDATA[Reply to Missed Call to write output on Mon, 19 Feb 2024 09:21:30 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://quantiacs.com/community/uid/1799">@magenta-kabuto</a> Hello. If you are developing your strategies in a local environment, I recommend running your strategy code in an online environment before submitting it to the competition.</p>
<p dir="auto">There may be errors related to the absence of certain Python libraries in the online environment, the use of local files, and the application of variables or settings from the local environment.</p>
<p dir="auto">It is important that the line</p>
<pre><code class="language-python">import qnt.output as qnout
qnout.write(weights)
</code></pre>
<p dir="auto">is placed in a separate cell.</p>
]]></description><link>http://quantiacs.com/community/post/1416</link><guid isPermaLink="true">http://quantiacs.com/community/post/1416</guid><dc:creator><![CDATA[Vyacheslav_B]]></dc:creator><pubDate>Mon, 19 Feb 2024 09:21:30 GMT</pubDate></item></channel></rss>