Question: I'm training a custom dataset in yolor. I successfully run its once but after some time, I cant manage to do it very well.

The first error I noticed is in the training part:

```
Traceback (most recent call last):   File "train.py", line 537, in <module>
    train(hyp, opt, device, tb_writer, wandb)   File "train.py", line 80, in train
    ckpt = torch.load(weights, map_location=device)  # load checkpoint   File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 595, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)   File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 764, in _legacy_load
    magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, '<'.

```

then i traced it and found that the pre trained weights didnt load correctly with this code:

```
%cd /content/yolor
!bash scripts/get_pretrain.sh

```

ann give me this error:

```
/content/yolor
awk: cannot open ./cookie (No such file or directory)

rm: cannot remove './cookie': No such file or directory

```

and that's the first and main thing I noticed comparing to what I've done, it should load the weight in there.

its just giving me a pre-trained files with some HTML code.

im using goolge colab btw

Answer: 
To compare two strings in `C` use the `strcmp(str1, str2)`, it compares two strings character by character. If the strings are equal, the function returns 0.

Instead of this `Guess != Password` use this `strcmp(Guess , Password) == 0`.
You cannot compare strings with `==` and `!=` operators in C. For that purpose use `strcmp()` function which is defined in `string.h` header file.

That was the reason integers were working but string weren't. You can say that you cannot compare arrays with those equality operators.

Also, you are using `scanf()` function to take user input with format specifier `"%s"`, which isn't very good, you should put a `limit`, for an example in your case `"%8s"`. Also, to store 8 characters long password you need to make `Guess` at-least 9 character long.

Once, password was denied and `Guesscount` is > 0, then use `memset()` to clear `Guess` so that it can read new data.

Final Code Should Be:

```
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main() {
  char Guess[9];
  memset(Guess, 0, 9);
  char Password[] = "password";
  int Guesscount = 3;
  int Granted = 1;

  while (strcmp(Guess, Password) != 0 && Granted == 1) {
    if (Guesscount > 0) {
      printf("Enter password: ");
      scanf("%8s", Guess);
      Guesscount = Guesscount - 1;
      if (strcmp(Guess, Password) != 0 && Guesscount > 0) {
        printf("Wrong Password, you have %d try left.\n", Guesscount);
        memset(Guess, 0, 9);
      }
    } else {
      Granted = 0;
    }
  }

  if (Granted == 0) {
    printf("Denied");
  } else {
    printf("Granted");
  }
  return 0;

}

```