のねのBlog

パソコンの問題や、ソフトウェアの開発で起きた問題など書いていきます。よろしくお願いします^^。

2019-04-01から1ヶ月間の記事一覧

dataframeから、複数範囲を指定したいとき

df_train = pd.read_csv(TRAIN_CSV) df_valid = pd.read_csv(VALID_CSV) df_test0 = df_valid.iloc[ 0:NB_CLASSES*1,:] #Bold df_test1 = df_valid.iloc[NB_CLASSES*1:NB_CLASSES*2,:] #Heavy df_test2 = df_valid.iloc[NB_CLASSES*2:NB_CLASSES*3,:] #Light…

jupyter notebookを開くと、白いBlankの画面になる。開かない。

Chromeで、シークレットモードで開いたら、開けた。 edgeでは、普通に開けた。 text/plainが影響しているらしい。 Chromeで、 CTRL+Shift+Rを白いBlankの画面で行ったら、 正常に開けるようになった。 Refused to execute script from '<URL>' because its MIME t</url>…

keras vgg19 64x64と128x128と224x224のときの違い

from keras.preprocessing import image import keras.applications.vgg19 as vgg19 model = vgg19.VGG19(weights=None, input_shape=(64, 64, 3)) model.summary() _________________________________________________________________ Layer (type) Output…

ValueError: When setting `include_top=True` and loading `imagenet` weights, `input_shape` should be (224, 224, 3).

from keras.preprocessing import image import keras.applications.vgg19 as vgg19 model = vgg19.VGG19(weights='imagenet', input_shape=(64, 64, 3)) model.summary() --------------------------------------------------------------------------- Val…

input shape

input_shape: optional shape tuple, only to be specified if `include_top` is False (otherwise the input shape has to be `(224, 224, 3)` (with `channels_last` data format) or `(3, 224, 224)` (with `channels_first` data format). It should hav…

pytorch expected image size 224 in pre-trained nn

All pre-trained models expect input images normalized in the same way, i.e. mini-batches of 3-channel RGB images of shape (3 x H x W), where H and W are expected to be at least 224. https://pytorch.org/docs/stable/torchvision/models.html

fastai create from ll

@classmethod def create_from_ll(cls, lls:LabelLists, bs:int=64, val_bs:int=None, ds_tfms:Optional[TfmList]=None, num_workers:int=defaults.cpus, dl_tfms:Optional[Collection[Callable]]=None, device:torch.device=None, test:Optional[PathOrStr]…

fastaiで、confusion_matrixの計算が、CPU側へ持ってくると、1/3になった。

3000クラスぐらいのconfusion_matrixの計算をすると時間が20分ぐらいかかった。 fastaiの、confusion_matrixの計算を,Tensorから、CPU側へ持ってきたら、1/3になった。 #かなり、時間がかかる20分ぐらいかかる import time t1 = time.time() interp.confus…

fastai split_by_idxs

各関数を分解しながら、代入していった。 #その3 #data = ImageDataBunch.from_csv(path, ds_tfms=tfms, size=128) folder = None label_delim = None csv_labels = 'labels.csv' valid_pct = 0.2 fn_col = 0 label_col = 1 suffix = '' delimiter = None h…

fastai split_by_idx

fastai split_by idxs forums.fast.ai

onenote 同期エラー 0x2 bd5f

エラーコード:0x2 bd5f 一度ノートを閉じると、保存できていないセクションが表示されるようになった。 もう一度、正しいノートを開いて、保存されてないセクションを移動した。 answers.microsoft.com

fastaiのplot_confusion_matrixでメモリが足りなくなる

interp.plot_confusion_matrix(figsize=(12,12), dpi=60) メモリが足りなくなったとき、slice_sizeを変えればいいようだ。 Working with large datasets When working with large datasets, memory problems can arise when computing the confusion matrix.…

matplot 文字化け

shimolab01.blogspot.com

学習用ラベルの生成

dir /S /B > dirs.txtの結果 test/A-OTF-UDShinGoPro-Regular/U+00004E01.png,U+00004E01_丁 U+数値の10桁を取得する U+00004E01 MID($A2,FIND("/U",$A2)+1,10)

エクセルで文字列抽出

=MID($A1,FIND("/U",$A1)+1,10) 元の文字列 train/A-OTF-ShinGoPro-Regular/U+000090C1.png 抽出文字列 U+000090C1

ファイル一覧を取得する方法

Windows10のコマンドで以下を実行する >dir /S /B > dir.txt

Visual Studio CodeでPythonをデバッグしようとしたときエラーになった

そのようなファイルやディレクトリはありません bashが動いている。 xset: unable to open display "localhost:0.0" xset: unable to open display "localhost:0.0" $ cd "c:\Users\m_fujii\Documents\0700_JNB\XJIS" ; env PYTHONIOENCODING=UTF-8 PYTHONUN…

UnicodeDecodeError: 'cp932' codec can't decode byte 0x83 in position 8: illegal multibyte sequence

--------------------------------------------------------------------------- UnicodeDecodeError Traceback (most recent call last) <ipython-input-30-2b56de3687e9> in <module> 12 is_unicode = True, 13 is_by_char = True, ---> 14 is_recursive =False) ~\Documents\0700_JNB\XJIS\font2i</module></ipython-input-30-2b56de3687e9>…

python imagefont

imagefont https://pillow.readthedocs.io/en/stable/reference/ImageFont.html ttfont https://stackoverflow.com/questions/43060479/how-to-get-the-font-pixel-height-using-pil-imagefont https://githubja.com/fonttools/fonttools +