PS C:\Users\Andrzej> bentoml containerize summarization:latest bentoml : The term…
- User
PS C:\Users\Andrzej> bentoml containerize summarization:latest bentoml : The term 'bentoml' is not recognized as the name of a cmdlet, function, script file, or operable pr ogram. Check the spelling of the name, or if a path was included, verify that the path is correct and try aga in. At line:1 char:1
- bentoml containerize summarization:latest
-
+ CategoryInfo : ObjectNotFound: (bentoml:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
- Assistant
The error message you're seeing indicates that the
bentomlcommand is not recognized in your PowerShell environment. This could be due to a few reasons:-
BentoML Not Installed: Make sure that BentoML is installed on your system. You can install it using pip:
pip install bentoml -
Path Not Set: If BentoML is installed but the command is not recognized, it may not be in your system's PATH. Here’s what you can do:
- Verify Installation: Check where BentoML is installed by running:
pip show bentoml - Set PATH: Ensure that the directory containing the BentoML executable is in your system's PATH.
- Verify Installation: Check where BentoML is installed by running:
-
Using Virtual Environment: If BentoML is installed in a virtual environment, make sure that the environment is activated. You can activate it using:
-
- User
Aby umieścić Bento w kontenerze za pomocą Dockera
- Assistant
Aby umieścić aplikację BentoML w kontenerze przy użyciu Dockera, wykonaj poniższe kroki. Zakładam, że masz już zainstalowane środowisko BentoML oraz Docker.
-
Stwórz aplikację BentoML: Upewnij się, że masz gotową aplikację BentoML, którą chcesz opakować w kontenerze. Na przykład, jeśli masz model o nazwie
summarization, zarejestruj go w BentoML. -
Stwórz projekt Bento: W katalogu projektu stwórz pliki wymagane przez BentoML, takie jak
service.py,bentofile.yaml, itp., aby zdefiniować swój serwis. -
Buduj serwis Bento: Z komendą:
bentoml buildTo polecenie stworzy pakiet Bento z Twoim modelem, zapisując go do lokalnego repozytorium BentoML.
-
- User
PS C:\Users\Andrzej> bentoml containerize <bento_name>: At line:1 char:22
- bentoml containerize <bento_name>:
-
~
The '<' operator is reserved for future use. + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : RedirectionNotSupported
- Assistant
W błędzie, który napotkałeś, problem wynika z użycia znaków
<i>w linii poleceń w PowerShellu. Symbole te są zarezerwowane dla operacji przekierowań w wielu powłokach, w tym w PowerShellu. Dlatego, jeśli chcesz użyć tego polecenia, nie używaj symboli<i>dosłownie. Użyj rzeczywistych nazw i wersji swojego pakietu Bento.Oto jak powinno wyglądać prawidłowe polecenie:
-
Znajdź nazwę i wersję modelu: Upewnij się, że znasz dokładną nazwę i wersję swojego pakietu Bento. Możesz uzyskać tę informację używając:
bentoml listTa komenda wyświetli listę wszystkich zarejestrowanych pakietów Bento wraz z ich wersjami.
-
Uruchom konteneryzację z poprawnymi wartościami: Zamień
<bento_name>i<version>na rzeczywistą nazwę i wersję swojego pakietu. Na przykład, jeśli Twój pakiet nazywa sięsummarizationi jego wersja tolatest, użyj:bentoml containerize summarization:latest
-
- User
PS C:\Users\Andrzej> docker run -it --rm -p 8888:8888 -p 3000:3000 bentoml/quickstart:latest Unable to find image 'bentoml/quickstart:latest' locally latest: Pulling from bentoml/quickstart cf92e523b49e: Pulling fs layer db27697afc27: Pulling fs layer
85ccf426c9dc: Pulling fs layer
4f4fb700ef54: Pulling fs layer
f068ea7e5741: Pulling fs layer
5213c35644a3: Pulling fs layer
665b66cc63a4: Waiting aab3e5070e78: Waiting 6639866a168d: Waiting 662d4fc36a82: Waiting b49dce63ff52: Waiting a72c652e39b4: Pull complete 921d00c3c0c9: Pull complete 48f049e24e6e: Pull complete 59133f10af45: Pull complete d119513f8b64: Pull complete 1b23d90ac489: Pull complete 9fe716f7cdaf: Pull complete Digest: sha256:8965cca36f43e1c732e13e65cfd3ec19affacd910154b553c5e057fb0fd16a44 Status: Downloaded newer image for bentoml/quickstart:latest docker: Error response from daemon: driver failed programming external connectivity on endpoint strange_rosalind (884ff5cd1c0f1381521734fcf39a8e135987442475859039fca3752db3f050c9): Bind for 0.0.0.0:3000 failed: port is already allocated. PS C:\Users\Andrzej> docker pull bentoml/quickstart Using default tag: latest latest: Pulling from bentoml/quickstart Digest: sha256:8965cca36f43e1c732e13e65cfd3ec19affacd910154b553c5e057fb0fd16a44 Status: Image is up to date for bentoml/quickstart:latest docker.io/bentoml/quickstart:latest - Assistant
Wydaje się, że napotykasz problem z uruchomieniem kontenera, ponieważ port 3000 na twoim komputerze jest już zajęty przez inny proces lub kontener. Możesz to naprawić na kilka sposobów:
-
Znajdź proces używający portu 3000: Aby zidentyfikować i ewentualnie zatrzymać proces używający portu 3000, możesz użyć narzędzia
netstatlubGet-NetTCPConnectionw PowerShellu:netstat -ano | findstr :3000lub za pomocą PowerShella:
Get-NetTCPConnection -LocalPort 3000Następnie możesz zidentyfikować numer PID i zatrzymać odpowiedni proces w Menedżerze Zadań lub przy użyciu:
Stop-Process -Id <PID>
-