This example works properly to find and replace from a Jupyter cell:
all_labels = ['cat', 'dog']
!sed -i 's/num_classes: 90/num_classes: {len(all_labels)}/g' {FILE_PATH}
However this example with the same syntax produces an error:
record_path = '/path/to/data.record'
!sed -i 's/PATH_TO_BE_CONFIGURED\/mscoco_train\.record/{record_path}/g' {FILE_PATH}
I added two forward slashes to escape the backslash and period so my regex tester would recognize the sentence. The error I get is:
sed: -e expression #1, char 50: unknown option to `s'
Anyone know why I can pass a variable in the first example, but not in the second?