# InvalidArgumentError: You must feed a value for placeholder tensor 'Placeholder' with dtype float and shape \[24,10\]

**URL:** <https://discuss.pennylane.ai/t/invalidargumenterror-you-must-feed-a-value-for-placeholder-tensor-placeholder-with-dtype-float-and-shape-24-10/1909>\
**Category:** PennyLane Help\
**Created:** [May 14, 2022, 10:13am UTC](https://discuss.pennylane.ai/t/invalidargumenterror-you-must-feed-a-value-for-placeholder-tensor-placeholder-with-dtype-float-and-shape-24-10/1909 "2022-05-14T10:13:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abrar2652](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/abrar2652/32/1035_2.png) [@Abrar2652](https://discuss.pennylane.ai/u/Abrar2652)\
**Post date:** [May 14, 2022, 10:13am UTC](https://discuss.pennylane.ai/t/invalidargumenterror-you-must-feed-a-value-for-placeholder-tensor-placeholder-with-dtype-float-and-shape-24-10/1909/1 "2022-05-14T10:13:27Z")

</div>

I’m getting the following error from the code derived from [https://github.com/Gruntrexpewrus/quantum-neural-networks/blob/master/fraud\_detection/fraud\_detection.py](https://github.com/Gruntrexpewrus/quantum-neural-networks/blob/master/fraud_detection/fraud_detection.py)

```
InvalidArgumentError: You must feed a value for placeholder tensor 'Placeholder' with dtype float and shape [24,10]
	 [[Node: Placeholder = Placeholder[dtype=DT_FLOAT, shape=[24,10], _device="/job:localhost/replica:0/task:0/cpu:0"]()]]

```

I have tried to fix this error by modifying the following line slightly:

```
        # Encoding classes into one-hot form
        one_hot_input = np.zeros((batch_size, 2))

        for i in range(batch_size):
            if int(classes[i]) == 0:
                # Encoded such that genuine transactions should be outputted as a photon in the first mode
                one_hot_input[i] = [1, 0]
            else:
                one_hot_input[i] = [0, 1]
                
        one_hot_input = one_hot_input.astype(float)

```

The array shape is already fine, so there is no need to modify it. Which portion of the code might be the cause of this datatype error and what could be the probable solution?

---

<div class="post-metadata">

**Author:** ![CatalinaAlbornoz](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/catalinaalbornoz/32/1196_2.png) [@CatalinaAlbornoz](https://discuss.pennylane.ai/u/CatalinaAlbornoz)\
**Post date:** [May 17, 2022, 12:18am UTC](https://discuss.pennylane.ai/t/invalidargumenterror-you-must-feed-a-value-for-placeholder-tensor-placeholder-with-dtype-float-and-shape-24-10/1909/2 "2022-05-17T00:18:04Z")

</div>

Hi @Abrar2652,

What versions of Strawberry Fields, TensorFlow and Python are you using?

---

<div class="post-metadata">

**Author:** ![Abrar2652](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/abrar2652/32/1035_2.png) [@Abrar2652](https://discuss.pennylane.ai/u/Abrar2652)\
**Post date:** [May 18, 2022, 7:13pm UTC](https://discuss.pennylane.ai/t/invalidargumenterror-you-must-feed-a-value-for-placeholder-tensor-placeholder-with-dtype-float-and-shape-24-10/1909/3 "2022-05-18T19:13:48Z")

</div>

@CatalinaAlbornoz I’m currently using Tensorflow 1.3 and Strawberryfields 0.10. Actually, the issue has been solved by restarting the kernel or resetting the placeholders. Could you please tell me if there is any other way of running this script except for Local Machine’s Jupyter Notebook? Because I’m unable to create any anaconda environment on Kaggle or Colab which is ultimately disabling me to reduce the runtime.

---

<div class="post-metadata">

**Author:** ![CatalinaAlbornoz](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/catalinaalbornoz/32/1196_2.png) [@CatalinaAlbornoz](https://discuss.pennylane.ai/u/CatalinaAlbornoz)\
**Post date:** [May 18, 2022, 11:02pm UTC](https://discuss.pennylane.ai/t/invalidargumenterror-you-must-feed-a-value-for-placeholder-tensor-placeholder-with-dtype-float-and-shape-24-10/1909/4 "2022-05-18T23:02:19Z")

</div>

@Abrar2652 You could use our cloud. We have hosted Jupyter notebooks with all of the necessary libraries pre-installed. I’m not sure if your code will run in the latest Strawberry Fields and tensorflow versions but it may be worth trying it.

You can request access to the cloud [here](https://xanadu.ai/access). It may take a few days for you to receive the email confirming access. If you let me know on [Slack](https://u.strawberryfields.ai/slack/) when you have requested access I can try to see if we can speed up the process to give you access.
