当运行程序时发现同样的程序在linux系统下运行正常,但是在win系统下却报错:【tensorflow.python.eager.profiler.ProfilerNotRunningError: Cannot stop profiling. No profiler is running.】
尝试一番后发现是tf.keras.callbacks.TensorBoard(log_dir=logdir)中logdir的问题。
有个地方需要注意: python在写地址时,通常会使用‘/’符号(例如:‘c:/users/desktop/’),但是对于tensorflow2.x而言,在win系统下会报错,因此只能不使用“/”符号。tensorflow2.x会默认将log地址建立在程序所在文件,所以可以直接写文件名,如果需要写带有"/"的地址,则使用“\\”代替。