2021-08

Deep Learning

TensorflowでOperatorNotAllowedInGraphError: using a `tf.Tensor` as a Python `bool` is not allowed in Graph execution. Use Eager execution or decorate this function with @tf.function.

tf.data.TFRecordDatasetでmapを使った時に表題のエラー。 mapしたい処理内容を単純化すると以下のような内容。 import tensorflow.experimental.numpy as tnp 2 ** tnp...
Deep Learning

TPUでTensorflow Hubの重みを使おうとしたらUnsuccessful TensorSliceReader constructor: Failed to get matching files on /tmp/tfhub_modules/

ColabのTPUでTensorflow Hubの重みを使おうとしたら表題のエラー hub.KerasLayer(' Unsuccessful TensorSliceReader constructor: Failed to get mat...
Linux

Ubuntuのswapfileにプライオリティを設定して疑似RAID0の高速化をする

Tensorflowで巨大なデータを学習させる時、物理メモリが足りなかったので仮想メモリを増やしたくなった。 しかし、swapfileの読み書きが思っていたよりも遅く、高速化したくなった。 マシンにはNVMeが1台、SSDが2台搭載されてい...