---
# System prepended metadata

title: Assignment 1 FAQs- FIT5225

---

# Assignment 1 FAQs- FIT5225

#### This is a sample FAQs page to answer the most commonly asked questions. Please consider it as a guideline and you are most welcome to follow your own approaches that works for you.

-----------------------
## Which  python version should I use?
#### We recomend to use python 3.5 or higher for the smooth working of all required components. 

## I can do  object detection with YOLO itself, why do I need opencv?

#### Opencv is required to tansform the image into different formats. You can also use it for loading the yolo weights. If you can do that without opencv or using any other packages, that also works. 

## I'm getting ReadDarknetFromCfgStream error when using yolov3-tiny.cfg and yolov3-tiny.weight for object detection.

#### If you have problem with reading of tiny files, please check that you have downloaded the files in correct format. Open files with an editor(ex: notepad++) and check the content are similar to the content from your links. If downloaded files include html tags they are downloaded with wrong format.  

## I am receiving empty responses for some images with yolov3-tiny. How do I resolve this?

#### This is an expected behaviour, yolov3-tiny uses a lightweight neural net, hence cannot detect the objects in all the images.

## My multithreaded server returns expected output when my input thread is 1, but an unexpected output with too many labels when I increase threads to more than 1. 

#### Please remember that your server is multithreaded (this is a  requirement). As  discussed in Tutorial 2, threads can share instance and global variables. In a multi-threaded world, we need to access shared objects across threads, and if we do not synchronize our work, unwanted situations can occur. Hence, your neural net object should be local to the service endpoint method to avoid such wrong outputs and have maximum paralellism. If you share the neural net object without synchronization, it can mix up mutiple requests and return wrong output.


## Which base image is bettter for docker image?

#### In general, most docker containers start with alphine/ slim-buster as it is a lightweight. However, since we are  using many python packages, we recomend to use debian based base images that has better support for python and generally works well. 

## How do I solve "libgthread-2.so.0: cannot open shared objects" in docker build process?
#### Your opencv and other python packages needs many dependecy packages. As many of you are using slim/ basic python, you have to identfy and install the required depedency packages. 

## I sucessfully built docker image, but after I running it, it shows exit status. What is the issue?

#### There might be multiple reasons for this. Please make sure you have correct command to invoke your python script in the Dockerfile and provide required arguments. Before running your object detction script, try the same Dockerfile with simple helloworld program. 

## What type of service do we need to use to expose our deployment?

#### Kubernetes offers several types of services such as Cluster IP, NodePort, Ingress, and LoadBalancer. For this assignment, it’s recommended to create a NodePort service to expose your deployment. You can specify custom node ports in your service definition YAML files. The following link explains the steps required to create, configure, and test a NodePort service in Kubernetes: https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/

## I created a deployment and service in Kubernetes cluster, I can see pods running, but could not access? How do I resolve this?
#### Please  keep in mind that you have to access the service end point not the pods directly. Make sure you have created "service" based on your deployment. Refer K8s tutorial document for this.



## I have trouble with accessing service outside, how do I solve this?

#### Please make sure you have opened the correct ports in your security list, firwall of your VM, configurations of VCN, and use Nodeport capabilites to map the ports in a correct manner. We suggest to expose service on port 80 or 8080 of your instance. 

## My deployment works for limited number of threads, but the  cluster crashes/ freezes, or I get "HTTP 504 error" when I increase thread number to a high number. What is the reason?

#### This is due to resource starvation. Please make sure your threads have a minimal local variables and share as much as possible using global or instance variables. For this project, the neural net object should be local and rest all can be shared between threads including configuration, weight files, etc,. It helps to reduce the resource demand and memory footprint. In addition, do not load any unnecessary packages in your script. Even after optimising all ends, if you cannot go beyond certain number of threads, you can only report results upto what number it works.

## Can we use OKE service of the Oracle for the assignment?

#### You cannot use OKE in your assignment. It does not allow you to get access directly to the master node.