# Loading validation set in DL python network learner node

**URL:** <https://forum.knime.com/t/loading-validation-set-in-dl-python-network-learner-node/71554>\
**Category:** KNIME Analytics Platform\
**Created:** [August 8, 2023, 9:50am UTC](https://forum.knime.com/t/loading-validation-set-in-dl-python-network-learner-node/71554 "2023-08-08T09:50:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadhana\_l](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/s/7993a0/32.png) [@Sadhana\_l](https://forum.knime.com/u/Sadhana_l)\
**Post date:** [August 8, 2023, 9:50am UTC](https://forum.knime.com/t/loading-validation-set-in-dl-python-network-learner-node/71554/1 "2023-08-08T09:50:06Z")

</div>

Hi,  
I’m trying to use the DL python network learner node for regression problem using tensorflow. I load the data as follows:

import tensorflow as tf  
from TFModel import TFModel  
import numpy as np

Get the training data from the table  
x\_train = input\_table.iloc[0:77093, 1:63].values  
y\_train = input\_table.iloc[0:77093, 0:1].values

#Get the validation data from the table  
x\_val = input\_table.iloc[77094:, 1:63].values  
y\_val = input\_table.iloc[77094:, 0:1].values

The above code loads x\_train and y\_train correctly. But I find that the x\_val and y\_val remains an empty array when executed. This leads to the validation loss over all epochs as 0. How can I resolve this ? I need to load the validation set and calculate the validation loss over epoch along with the training loss. Any suggestion is much appreciated.  
I used this flow as reference to build mine: [Train a MLP – KNIME Community Hub](https://hub.knime.com/-/spaces/-/latest/~WmFKDNILzOP2_bHT/)  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Daniel\_Weikert](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/d/e47c2d/32.png) [@Daniel\_Weikert](https://forum.knime.com/u/Daniel_Weikert)\
**Post date:** [August 8, 2023, 3:45pm UTC](https://forum.knime.com/t/loading-validation-set-in-dl-python-network-learner-node/71554/2 "2023-08-08T15:45:47Z")

</div>

Hi  
have you checked the length of your dataset? E.g. using .shape and see whether ther is a 77094 row?  
br

---

<div class="post-metadata">

**Author:** ![Sadhana\_l](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/s/7993a0/32.png) [@Sadhana\_l](https://forum.knime.com/u/Sadhana_l)\
**Post date:** [August 10, 2023, 12:06pm UTC](https://forum.knime.com/t/loading-validation-set-in-dl-python-network-learner-node/71554/3 "2023-08-10T12:06:33Z")

</div>

Yes. There is a total of 90698 rows. out of which 77093 is given as training set and the rest as validation.

---

<div class="post-metadata">

**Author:** ![steffen\_KNIME](https://forum-cdn.knime.com/user_avatar/forum.knime.com/steffen_knime/32/33719_2.png) [@steffen\_KNIME](https://forum.knime.com/u/steffen_KNIME)\
**Post date:** [August 15, 2023, 12:44pm UTC](https://forum.knime.com/t/loading-validation-set-in-dl-python-network-learner-node/71554/4 "2023-08-15T12:44:29Z")

</div>

Hi @Sadhana_l,

what happens if you  
`print(input_table.iloc[77094:, 1:63].values)`  
`print(input_table.iloc[77094:, 1:63])`  
`print(input_table.iloc[77094:, 0:1].values)`  
`print(input_table.iloc[77094:, 0:1])`  
?  
Can you try to isolate the issue? e.g.  
`print(input_table.iloc[77094:78000, 1:63].values)`  
and then work your way through to  
`print(input_table.iloc[77094:90697, 1:63].values)`  
and see where it gets empty?

Best regards  
Steffen

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [November 13, 2023, 12:44pm UTC](https://forum.knime.com/t/loading-validation-set-in-dl-python-network-learner-node/71554/5 "2023-11-13T12:44:40Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
