Skip to content

Commit

Permalink
fix 'NotImplementedError: cannot instantiate 'PosixPath' on your syst…
Browse files Browse the repository at this point in the history
…em' error for windows
  • Loading branch information
JosuaLimbu committed Jan 21, 2024
1 parent 16b85bf commit c9f6579
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@
import platform
import sys
from pathlib import Path
import pathlib # added for Windows compatibility
pathlib.PosixPath = pathlib.WindowsPath # and fix "NotImplementedError: cannot instantiate 'PosixPath' on your system" error
import torch
# import pathlib # # uncomment if you are using windows
# fix "NotImplementedError: cannot instantiate 'PosixPath' on your system" error for windows

# pathlib.PosixPath = pathlib.WindowsPath # uncomment if you are using windows
import torch
FILE = Path(__file__).resolve()
ROOT = FILE.parents[0] # YOLOv5 root directory
if str(ROOT) not in sys.path:
Expand Down

0 comments on commit c9f6579

Please sign in to comment.