実現したいこと
Google ColabでKerasを試した際にエラー(InvalidArgumentError: Graph execution error)が出てしまい改善しません。https://teratail.com/questions/4xse8bqij3aiatを確認しましたが,解決済なものが削除されたとのこと…
なお,Google Drive内の全csvファイルに3列ほどデータを追加する前は,問題なく実行可能でした。
解決策をご存知な方は,ご教示いただけますと幸いです。
発生している問題・エラーメッセージ
InvalidArgumentError Traceback (most recent call last) <ipython-input-2-bb8e73d2cf55> in <module> 119 ) 120 # 学習モデルにデータを与えて学習させる --> 121 model.fit( 122 train_gen, 123 epochs = epochs, 1 frames /usr/local/lib/python3.8/dist-packages/tensorflow/python/eager/execute.py in quick_execute(op_name, num_outputs, inputs, attrs, ctx, name) 50 try: 51 ctx.ensure_initialized() ---> 52 tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name, 53 inputs, attrs, num_outputs) 54 except core._NotOkStatusException as e: InvalidArgumentError: Graph execution error: 2 root error(s) found. (0) INVALID_ARGUMENT: ValueError: Input contains infinity or a value too large for dtype('float64'). Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/ops/script_ops.py", line 271, in __call__ ret = func(*args) File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/autograph/impl/api.py", line 642, in wrapper return func(*args, **kwargs) File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/data/ops/dataset_ops.py", line 1039, in generator_py_func values = next(generator_state.get_iterator(iterator_id)) File "/usr/local/lib/python3.8/dist-packages/keras/engine/data_adapter.py", line 901, in wrapped_generator for data in generator_fn(): File "<ipython-input-2-bb8e73d2cf55>", line 36, in generator data = StandardScaler().fit_transform(data.reshape(-1, 1)).reshape(data.shape) File "/usr/local/lib/python3.8/dist-packages/sklearn/base.py", line 852, in fit_transform return self.fit(X, **fit_params).transform(X) File "/usr/local/lib/python3.8/dist-packages/sklearn/preprocessing/_data.py", line 806, in fit return self.partial_fit(X, y, sample_weight) File "/usr/local/lib/python3.8/dist-packages/sklearn/preprocessing/_data.py", line 841, in partial_fit X = self._validate_data( File "/usr/local/lib/python3.8/dist-packages/sklearn/base.py", line 566, in _validate_data X = check_array(X, **check_params) File "/usr/local/lib/python3.8/dist-packages/sklearn/utils/validation.py", line 800, in check_array _assert_all_finite(array, allow_nan=force_all_finite == "allow-nan") File "/usr/local/lib/python3.8/dist-packages/sklearn/utils/validation.py", line 114, in _assert_all_finite raise ValueError( ValueError: Input contains infinity or a value too large for dtype('float64'). [[{{node PyFunc}}]] [[IteratorGetNext]] [[IteratorGetNext/_8]] (1) INVALID_ARGUMENT: ValueError: Input contains infinity or a value too large for dtype('float64'). Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/ops/script_ops.py", line 271, in __call__ ret = func(*args) File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/autograph/impl/api.py", line 642, in wrapper return func(*args, **kwargs) File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/data/ops/dataset_ops.py", line 1039, in generator_py_func values = next(generator_state.get_iterator(iterator_id)) File "/usr/local/lib/python3.8/dist-packages/keras/engine/data_adapter.py", line 901, in wrapped_generator for data in generator_fn(): File "<ipython-input-2-bb8e73d2cf55>", line 36, in generator data = StandardScaler().fit_transform(data.reshape(-1, 1)).reshape(data.shape) File "/usr/local/lib/python3.8/dist-packages/sklearn/base.py", line 852, in fit_transform return self.fit(X, **fit_params).transform(X) File "/usr/local/lib/python3.8/dist-packages/sklearn/preprocessing/_data.py", line 806, in fit return self.partial_fit(X, y, sample_weight) File "/usr/local/lib/python3.8/dist-packages/sklearn/preprocessing/_data.py", line 841, in partial_fit X = self._validate_data( File "/usr/local/lib/python3.8/dist-packages/sklearn/base.py", line 566, in _validate_data X = check_array(X, **check_params) File "/usr/local/lib/python3.8/dist-packages/sklearn/utils/validation.py", line 800, in check_array _assert_all_finite(array, allow_nan=force_all_finite == "allow-nan") File "/usr/local/lib/python3.8/dist-packages/sklearn/utils/validation.py", line 114, in _assert_all_finite raise ValueError( ValueError: Input contains infinity or a value too large for dtype('float64'). [[{{node PyFunc}}]] [[IteratorGetNext]] 0 successful operations. 0 derived errors ignored. [Op:__inference_train_function_7490]
回答3件
あなたの回答
tips
プレビュー