Browse Source

adding small experiment

master
ccl 2 years ago
parent
commit
147ce2068f
  1. 195
      picelate.ipynb

195
picelate.ipynb

@ -0,0 +1,195 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "north-steering",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"pip 20.3.4 from /usr/lib/python3/dist-packages/pip (python 3.9)\n",
"Note: you may need to restart the kernel to use updated packages.\n"
]
}
],
"source": [
"pip -V"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "ranking-bottom",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: tensorflow in /home/ccl/.local/lib/python3.9/site-packages (2.10.0)\n",
"Requirement already satisfied: typing-extensions>=3.6.6 in /home/ccl/.local/lib/python3.9/site-packages (from tensorflow) (4.4.0)\n",
"Requirement already satisfied: h5py>=2.9.0 in /home/ccl/.local/lib/python3.9/site-packages (from tensorflow) (3.7.0)\n",
"Requirement already satisfied: tensorflow-io-gcs-filesystem>=0.23.1 in /home/ccl/.local/lib/python3.9/site-packages (from tensorflow) (0.27.0)\n",
"Requirement already satisfied: tensorflow-estimator<2.11,>=2.10.0 in /home/ccl/.local/lib/python3.9/site-packages (from tensorflow) (2.10.0)\n",
"Requirement already satisfied: libclang>=13.0.0 in /home/ccl/.local/lib/python3.9/site-packages (from tensorflow) (14.0.6)\n",
"Requirement already satisfied: wrapt>=1.11.0 in /home/ccl/.local/lib/python3.9/site-packages (from tensorflow) (1.14.1)\n",
"Requirement already satisfied: absl-py>=1.0.0 in /home/ccl/.local/lib/python3.9/site-packages (from tensorflow) (1.3.0)\n",
"Requirement already satisfied: google-pasta>=0.1.1 in /home/ccl/.local/lib/python3.9/site-packages (from tensorflow) (0.2.0)\n",
"Requirement already satisfied: grpcio<2.0,>=1.24.3 in /home/ccl/.local/lib/python3.9/site-packages (from tensorflow) (1.50.0)\n",
"Requirement already satisfied: opt-einsum>=2.3.2 in /home/ccl/.local/lib/python3.9/site-packages (from tensorflow) (3.3.0)\n",
"Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from tensorflow) (52.0.0)\n",
"Requirement already satisfied: astunparse>=1.6.0 in /home/ccl/.local/lib/python3.9/site-packages (from tensorflow) (1.6.3)\n",
"Collecting keras<2.11,>=2.10.0\n",
" Using cached keras-2.10.0-py2.py3-none-any.whl (1.7 MB)\n",
"Requirement already satisfied: tensorboard<2.11,>=2.10 in /home/ccl/.local/lib/python3.9/site-packages (from tensorflow) (2.10.1)\n",
"Requirement already satisfied: gast<=0.4.0,>=0.2.1 in /home/ccl/.local/lib/python3.9/site-packages (from tensorflow) (0.4.0)\n",
"Requirement already satisfied: numpy>=1.20 in /home/ccl/.local/lib/python3.9/site-packages (from tensorflow) (1.23.4)\n",
"Requirement already satisfied: six>=1.12.0 in /home/ccl/.local/lib/python3.9/site-packages (from tensorflow) (1.16.0)\n",
"Requirement already satisfied: protobuf<3.20,>=3.9.2 in /home/ccl/.local/lib/python3.9/site-packages (from tensorflow) (3.19.6)\n",
"Requirement already satisfied: packaging in /home/ccl/.local/lib/python3.9/site-packages (from tensorflow) (21.3)\n",
"Requirement already satisfied: termcolor>=1.1.0 in /home/ccl/.local/lib/python3.9/site-packages (from tensorflow) (2.0.1)\n",
"Requirement already satisfied: keras-preprocessing>=1.1.1 in /home/ccl/.local/lib/python3.9/site-packages (from tensorflow) (1.1.2)\n",
"Requirement already satisfied: flatbuffers>=2.0 in /home/ccl/.local/lib/python3.9/site-packages (from tensorflow) (22.9.24)\n",
"Requirement already satisfied: wheel<1.0,>=0.23.0 in /usr/lib/python3/dist-packages (from astunparse>=1.6.0->tensorflow) (0.34.2)\n",
"Requirement already satisfied: requests<3,>=2.21.0 in /usr/lib/python3/dist-packages (from tensorboard<2.11,>=2.10->tensorflow) (2.25.1)\n",
"Requirement already satisfied: tensorboard-data-server<0.7.0,>=0.6.0 in /home/ccl/.local/lib/python3.9/site-packages (from tensorboard<2.11,>=2.10->tensorflow) (0.6.1)\n",
"Requirement already satisfied: werkzeug>=1.0.1 in /home/ccl/.local/lib/python3.9/site-packages (from tensorboard<2.11,>=2.10->tensorflow) (2.0.2)\n",
"Requirement already satisfied: markdown>=2.6.8 in /home/ccl/.local/lib/python3.9/site-packages (from tensorboard<2.11,>=2.10->tensorflow) (3.3.6)\n",
"Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in /home/ccl/.local/lib/python3.9/site-packages (from tensorboard<2.11,>=2.10->tensorflow) (0.4.6)\n",
"Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in /home/ccl/.local/lib/python3.9/site-packages (from tensorboard<2.11,>=2.10->tensorflow) (1.8.1)\n",
"Requirement already satisfied: google-auth<3,>=1.6.3 in /home/ccl/.local/lib/python3.9/site-packages (from tensorboard<2.11,>=2.10->tensorflow) (2.13.0)\n",
"Requirement already satisfied: cachetools<6.0,>=2.0.0 in /home/ccl/.local/lib/python3.9/site-packages (from google-auth<3,>=1.6.3->tensorboard<2.11,>=2.10->tensorflow) (5.2.0)\n",
"Requirement already satisfied: pyasn1-modules>=0.2.1 in /usr/lib/python3/dist-packages (from google-auth<3,>=1.6.3->tensorboard<2.11,>=2.10->tensorflow) (0.2.1)\n",
"Requirement already satisfied: rsa<5,>=3.1.4 in /home/ccl/.local/lib/python3.9/site-packages (from google-auth<3,>=1.6.3->tensorboard<2.11,>=2.10->tensorflow) (4.9)\n",
"Requirement already satisfied: requests-oauthlib>=0.7.0 in /home/ccl/.local/lib/python3.9/site-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.11,>=2.10->tensorflow) (1.3.1)\n",
"Requirement already satisfied: importlib-metadata>=4.4 in /home/ccl/.local/lib/python3.9/site-packages (from markdown>=2.6.8->tensorboard<2.11,>=2.10->tensorflow) (5.0.0)\n",
"Requirement already satisfied: zipp>=0.5 in /home/ccl/.local/lib/python3.9/site-packages (from importlib-metadata>=4.4->markdown>=2.6.8->tensorboard<2.11,>=2.10->tensorflow) (3.10.0)\n",
"Requirement already satisfied: oauthlib>=3.0.0 in /home/ccl/.local/lib/python3.9/site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.11,>=2.10->tensorflow) (3.2.2)\n",
"Requirement already satisfied: pyasn1>=0.1.3 in /usr/lib/python3/dist-packages (from rsa<5,>=3.1.4->google-auth<3,>=1.6.3->tensorboard<2.11,>=2.10->tensorflow) (0.4.8)\n",
"Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /home/ccl/.local/lib/python3.9/site-packages (from packaging->tensorflow) (3.0.9)\n",
"Installing collected packages: keras\n",
" Attempting uninstall: keras\n",
" Found existing installation: Keras 2.2.5\n",
" Uninstalling Keras-2.2.5:\n",
" Successfully uninstalled Keras-2.2.5\n",
"Successfully installed keras-2.10.0\n",
"Collecting keras==2.2.5\n",
" Using cached Keras-2.2.5-py2.py3-none-any.whl (336 kB)\n",
"Requirement already satisfied: keras-preprocessing>=1.1.0 in /home/ccl/.local/lib/python3.9/site-packages (from keras==2.2.5) (1.1.2)\n",
"Requirement already satisfied: keras-applications>=1.0.8 in /home/ccl/.local/lib/python3.9/site-packages (from keras==2.2.5) (1.0.8)\n",
"Requirement already satisfied: scipy>=0.14 in /home/ccl/.local/lib/python3.9/site-packages (from keras==2.2.5) (1.9.3)\n",
"Requirement already satisfied: h5py in /home/ccl/.local/lib/python3.9/site-packages (from keras==2.2.5) (3.7.0)\n",
"Requirement already satisfied: numpy>=1.9.1 in /home/ccl/.local/lib/python3.9/site-packages (from keras==2.2.5) (1.23.4)\n",
"Requirement already satisfied: pyyaml in /home/ccl/.local/lib/python3.9/site-packages (from keras==2.2.5) (6.0)\n",
"Requirement already satisfied: six>=1.9.0 in /home/ccl/.local/lib/python3.9/site-packages (from keras==2.2.5) (1.16.0)\n",
"Installing collected packages: keras\n",
" Attempting uninstall: keras\n",
" Found existing installation: keras 2.10.0\n",
" Uninstalling keras-2.10.0:\n",
" Successfully uninstalled keras-2.10.0\n",
"\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n",
"tensorflow 2.10.0 requires keras<2.11,>=2.10.0, but you have keras 2.2.5 which is incompatible.\u001b[0m\n",
"Successfully installed keras-2.2.5\n",
"Requirement already satisfied: pincelate in /home/ccl/.local/lib/python3.9/site-packages (0.0.1)\n",
"Requirement already satisfied: scikit-learn>=0.20.0 in /home/ccl/.local/lib/python3.9/site-packages (from pincelate) (1.1.3)\n",
"Requirement already satisfied: Keras>=2.2.0 in /home/ccl/.local/lib/python3.9/site-packages (from pincelate) (2.2.5)\n",
"Requirement already satisfied: pronouncing>=0.2.0 in /home/ccl/.local/lib/python3.9/site-packages (from pincelate) (0.2.0)\n",
"Requirement already satisfied: h5py in /home/ccl/.local/lib/python3.9/site-packages (from Keras>=2.2.0->pincelate) (3.7.0)\n",
"Requirement already satisfied: numpy>=1.9.1 in /home/ccl/.local/lib/python3.9/site-packages (from Keras>=2.2.0->pincelate) (1.23.4)\n",
"Requirement already satisfied: scipy>=0.14 in /home/ccl/.local/lib/python3.9/site-packages (from Keras>=2.2.0->pincelate) (1.9.3)\n",
"Requirement already satisfied: keras-preprocessing>=1.1.0 in /home/ccl/.local/lib/python3.9/site-packages (from Keras>=2.2.0->pincelate) (1.1.2)\n",
"Requirement already satisfied: six>=1.9.0 in /home/ccl/.local/lib/python3.9/site-packages (from Keras>=2.2.0->pincelate) (1.16.0)\n",
"Requirement already satisfied: pyyaml in /home/ccl/.local/lib/python3.9/site-packages (from Keras>=2.2.0->pincelate) (6.0)\n",
"Requirement already satisfied: keras-applications>=1.0.8 in /home/ccl/.local/lib/python3.9/site-packages (from Keras>=2.2.0->pincelate) (1.0.8)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: cmudict>=0.4.0 in /home/ccl/.local/lib/python3.9/site-packages (from pronouncing>=0.2.0->pincelate) (1.0.2)\n",
"Requirement already satisfied: threadpoolctl>=2.0.0 in /home/ccl/.local/lib/python3.9/site-packages (from scikit-learn>=0.20.0->pincelate) (3.1.0)\n",
"Requirement already satisfied: joblib>=1.0.0 in /home/ccl/.local/lib/python3.9/site-packages (from scikit-learn>=0.20.0->pincelate) (1.1.0)\n"
]
}
],
"source": [
"import sys\n",
"!{sys.executable} -m pip install tensorflow==1.15.0\n",
"!{sys.executable} -m pip install keras==2.2.5\n",
"!{sys.executable} -m pip install pincelate"
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "polar-modeling",
"metadata": {},
"outputs": [],
"source": [
"from pincelate import Pincelate"
]
},
{
"cell_type": "code",
"execution_count": 22,
"id": "muslim-labor",
"metadata": {},
"outputs": [
{
"ename": "AttributeError",
"evalue": "module 'tensorflow' has no attribute 'placeholder'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn [22], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m pin \u001b[38;5;241m=\u001b[39m \u001b[43mPincelate\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/.local/lib/python3.9/site-packages/pincelate/__init__.py:41\u001b[0m, in \u001b[0;36mPincelate.__init__\u001b[0;34m(self, model_path_prefixes)\u001b[0m\n\u001b[1;32m 38\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mphon2orth \u001b[38;5;241m=\u001b[39m Seq2Seq\u001b[38;5;241m.\u001b[39mload(model_path_prefixes[\u001b[38;5;241m1\u001b[39m])\n\u001b[1;32m 39\u001b[0m \u001b[38;5;66;03m# otherwise, use the models in the package\u001b[39;00m\n\u001b[1;32m 40\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m---> 41\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39morth2phon \u001b[38;5;241m=\u001b[39m \u001b[43mSeq2Seq\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mload_from_package\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 42\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mmodels/orth-phon-enc256-dec256\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m 43\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mphon2orth \u001b[38;5;241m=\u001b[39m Seq2Seq\u001b[38;5;241m.\u001b[39mload_from_package(\n\u001b[1;32m 44\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mmodels/phon-orth-enc256-dec256\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[1;32m 46\u001b[0m \u001b[38;5;66;03m# looking up the closest arpabet phonemes when sounding out\u001b[39;00m\n",
"File \u001b[0;32m~/.local/lib/python3.9/site-packages/pincelate/seq2seq.py:183\u001b[0m, in \u001b[0;36mSeq2Seq.load_from_package\u001b[0;34m(cls, prefix)\u001b[0m\n\u001b[1;32m 181\u001b[0m obj_data \u001b[38;5;241m=\u001b[39m pickle\u001b[38;5;241m.\u001b[39mload(fh)\n\u001b[1;32m 182\u001b[0m obj \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mcls\u001b[39m(\u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mobj_data)\n\u001b[0;32m--> 183\u001b[0m \u001b[43mobj\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmake_models\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 184\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m rs(\u001b[38;5;18m__name__\u001b[39m, prefix \u001b[38;5;241m+\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m-training.h5\u001b[39m\u001b[38;5;124m\"\u001b[39m) \u001b[38;5;28;01mas\u001b[39;00m fh:\n\u001b[1;32m 185\u001b[0m obj\u001b[38;5;241m.\u001b[39mtraining_model\u001b[38;5;241m.\u001b[39mload_weights(fh)\n",
"File \u001b[0;32m~/.local/lib/python3.9/site-packages/pincelate/seq2seq.py:40\u001b[0m, in \u001b[0;36mSeq2Seq.make_models\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 34\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mmake_models\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[1;32m 35\u001b[0m \n\u001b[1;32m 36\u001b[0m \u001b[38;5;66;03m#\u001b[39;00m\n\u001b[1;32m 37\u001b[0m \u001b[38;5;66;03m# training models\u001b[39;00m\n\u001b[1;32m 38\u001b[0m \u001b[38;5;66;03m#\u001b[39;00m\n\u001b[0;32m---> 40\u001b[0m training_encoder_inputs \u001b[38;5;241m=\u001b[39m \u001b[43mInput\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 41\u001b[0m \u001b[43m \u001b[49m\u001b[43mshape\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m(\u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mlen\u001b[39;49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msrc_vocab\u001b[49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 42\u001b[0m \u001b[43m \u001b[49m\u001b[43mname\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mtraining_encoder_inputs\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\n\u001b[1;32m 43\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 45\u001b[0m \u001b[38;5;66;03m# masking to exclude zero-padding in loss/accuracy calculation\u001b[39;00m\n\u001b[1;32m 46\u001b[0m training_encoder_mask \u001b[38;5;241m=\u001b[39m Masking(\n\u001b[1;32m 47\u001b[0m \u001b[38;5;241m0.0\u001b[39m,\n\u001b[1;32m 48\u001b[0m name\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtraining_encoder_mask\u001b[39m\u001b[38;5;124m'\u001b[39m)(training_encoder_inputs)\n",
"File \u001b[0;32m~/.local/lib/python3.9/site-packages/keras/engine/input_layer.py:175\u001b[0m, in \u001b[0;36mInput\u001b[0;34m(shape, batch_shape, name, dtype, sparse, tensor)\u001b[0m\n\u001b[1;32m 173\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m dtype:\n\u001b[1;32m 174\u001b[0m dtype \u001b[38;5;241m=\u001b[39m K\u001b[38;5;241m.\u001b[39mfloatx()\n\u001b[0;32m--> 175\u001b[0m input_layer \u001b[38;5;241m=\u001b[39m \u001b[43mInputLayer\u001b[49m\u001b[43m(\u001b[49m\u001b[43mbatch_input_shape\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mbatch_shape\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 176\u001b[0m \u001b[43m \u001b[49m\u001b[43mname\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mname\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdtype\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdtype\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 177\u001b[0m \u001b[43m \u001b[49m\u001b[43msparse\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43msparse\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 178\u001b[0m \u001b[43m \u001b[49m\u001b[43minput_tensor\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtensor\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 179\u001b[0m \u001b[38;5;66;03m# Return tensor including _keras_shape and _keras_history.\u001b[39;00m\n\u001b[1;32m 180\u001b[0m \u001b[38;5;66;03m# Note that in this case train_output and test_output are the same pointer.\u001b[39;00m\n\u001b[1;32m 181\u001b[0m outputs \u001b[38;5;241m=\u001b[39m input_layer\u001b[38;5;241m.\u001b[39m_inbound_nodes[\u001b[38;5;241m0\u001b[39m]\u001b[38;5;241m.\u001b[39moutput_tensors\n",
"File \u001b[0;32m~/.local/lib/python3.9/site-packages/keras/legacy/interfaces.py:91\u001b[0m, in \u001b[0;36mgenerate_legacy_interface.<locals>.legacy_support.<locals>.wrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 88\u001b[0m signature \u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m)`\u001b[39m\u001b[38;5;124m'\u001b[39m\n\u001b[1;32m 89\u001b[0m warnings\u001b[38;5;241m.\u001b[39mwarn(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mUpdate your `\u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;241m+\u001b[39m object_name \u001b[38;5;241m+\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m` call to the \u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;241m+\u001b[39m\n\u001b[1;32m 90\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mKeras 2 API: \u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;241m+\u001b[39m signature, stacklevel\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m2\u001b[39m)\n\u001b[0;32m---> 91\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfunc\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/.local/lib/python3.9/site-packages/keras/engine/input_layer.py:84\u001b[0m, in \u001b[0;36mInputLayer.__init__\u001b[0;34m(self, input_shape, batch_size, batch_input_shape, dtype, input_tensor, sparse, name)\u001b[0m\n\u001b[1;32m 82\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m input_tensor \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 83\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mis_placeholder \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mTrue\u001b[39;00m\n\u001b[0;32m---> 84\u001b[0m input_tensor \u001b[38;5;241m=\u001b[39m \u001b[43mK\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mplaceholder\u001b[49m\u001b[43m(\u001b[49m\u001b[43mshape\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mbatch_input_shape\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 85\u001b[0m \u001b[43m \u001b[49m\u001b[43mdtype\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdtype\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 86\u001b[0m \u001b[43m \u001b[49m\u001b[43msparse\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msparse\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 87\u001b[0m \u001b[43m \u001b[49m\u001b[43mname\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mname\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 88\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 89\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mis_placeholder \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mFalse\u001b[39;00m\n",
"File \u001b[0;32m~/.local/lib/python3.9/site-packages/keras/backend/tensorflow_backend.py:541\u001b[0m, in \u001b[0;36mplaceholder\u001b[0;34m(shape, ndim, dtype, sparse, name)\u001b[0m\n\u001b[1;32m 539\u001b[0m x \u001b[38;5;241m=\u001b[39m tf\u001b[38;5;241m.\u001b[39msparse_placeholder(dtype, shape\u001b[38;5;241m=\u001b[39mshape, name\u001b[38;5;241m=\u001b[39mname)\n\u001b[1;32m 540\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m--> 541\u001b[0m x \u001b[38;5;241m=\u001b[39m \u001b[43mtf\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mplaceholder\u001b[49m(dtype, shape\u001b[38;5;241m=\u001b[39mshape, name\u001b[38;5;241m=\u001b[39mname)\n\u001b[1;32m 542\u001b[0m x\u001b[38;5;241m.\u001b[39m_keras_shape \u001b[38;5;241m=\u001b[39m shape\n\u001b[1;32m 543\u001b[0m x\u001b[38;5;241m.\u001b[39m_uses_learning_phase \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mFalse\u001b[39;00m\n",
"\u001b[0;31mAttributeError\u001b[0m: module 'tensorflow' has no attribute 'placeholder'"
]
}
],
"source": [
"pin = Pincelate()\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "graphic-appearance",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.2"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading…
Cancel
Save