Skip to content
Advertisement

An error about TypeError: expected str, bytes or os.PathLike object, not NoneType

I tried to correct English grammar by running a model.

My development environment is Linux + Anaconda3 + Python 3.6 + CUDA 9.0 + tensorflow1.9.0

After I ran the model, there was the following problem with the test:

JavaScript

How should I solve this problem?

Advertisement

Answer

It would be helpful to see some code but it looks like the a variable in a = os.fspath(a) is of type NoneType. The a variable should either be a string, bytes or an os.PathLike object in order to work with the os.fspath function.

You can check the Python documentation on the os.fspath function: python docs

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement